Reputation: 405
I would like to know how to preview the image after it is selected, and before submitting the form on Laravel Nova 4?
# App/Nova/Image.php
/**
* Get the fields displayed by the resource.
*
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return array
*/
public function fields(NovaRequest $request)
{
return [
ID::make()->sortable(),
Image::make('image')->disk('s3')->path('s3-uploads/event_images')->acceptedTypes('image/*'),
];
}
Is it possible to execute custom javascript on a Laravel Nova Form that detects when the image file is selected and inserts a preview in the form? Or is there a simpler / recommended way to do it?
Thank you
Upvotes: 1
Views: 1439
Reputation: 122
Dear you can use packages or create custom filed about package I will recommend some package:
Upvotes: 1