Closed mikebronner closed 4 years ago
Sorry about the lack of documentation. Will work on that. In the mean while:
composer require genealabs\nova-file-upload-field
.
<?php namespace App\Nova;
use GeneaLabs\NovaFileUploadField\FileUpload; use Laravel\Nova\Fields\ID; use Laravel\Nova\Fields\Text; use Laravel\Nova\Fields\Textarea;
class Image extends Resource { public static $model = 'App\Image'; public static $title = 'title'; public static $search = [ "id", "description", "title", ];
public function fields(Request $request)
{
return [
ID::make()
->sortable(),
Text::make("Title", "title")
->sortable()
->rules("required", "max:255"),
FileUpload::make("Image", "path")
->thumbnail(function ($image) {
return $image
? asset($image)
: '';
})
->disk("tenant")
->path("media")
->prunable(),
Textarea::make("Description"),
];
}
}
Sweet, thank you @mikebronner!
@kirschbaum NP :) please let me know if you encounter any issues, or have ideas for improvements. :)
typo in
composer require genealabs\nova-file-upload-field
this worked
composer require generalabs/nova-file-upload-field
Would love to try this package. Would be great to know how to install and get it set up.