Integrating NovaFileArtisan (Larupload) with Image Resource
Since v6.1.0
To enhance your Nova application's image handling capabilities, you can seamlessly integrate NovaFileArtisan, a feature-rich file uploader package that serves as a wrapper for Larupload. Follow these steps to incorporate NovaFileArtisan into your Image Resource:
Replace ImageUpload with NovaFileArtisan field in your Nova resource:
<?phpnamespaceApp\Nova\Resources;useApp\Nova\Resource;useIlluminate\Http\Request;useLaravel\Nova\Fields\Text;useApp\Models\Imageas ImageModel;useMostafaznv\NovaFileArtisan\Fields\NovaFileArtisan;useMostafaznv\NovaFileArtisan\Fields\NovaFileArtisanMeta;classImageextendsResource{publicstaticstring $model =ImageModel::class;publicfunctionfields(Request $request):array {return [Text::make(trans('Name'),'name')->showOnPreview()->help(trans('The file name that should be searched'))->sortable(),NovaFileArtisan::make('File','file')->showOnPreview()->rules('required','mimes:jpg,jpeg,png,gif,webp','max:5000')->help(trans(':size Megabyte Max FileSize.', ['size'=>5])),...NovaFileArtisanMeta::make('file')->all(), ]; }}
You're Done!
These steps empower your Nova application with advanced file handling capabilities using NovaFileArtisan. Feel free to explore additional features and customization options offered by Larupload and NovaFileArtisan.