Джамал
How to save a file from a form in a closure action?
CreateAction::make('addReport')
->model(OrderVehicleReport::class)
->label(('Add report'))
->form([
Select::make('order_vehicle_id')
->relationship('orderVehicle', 'brand')
->label(('Select car'))
->required()
->options($vehicles),
TextInput::make('stage')
->translateLabel(),
Textarea::make('description')->translateLabel(),
SpatieMediaLibraryFileUpload::make('media')
->minFiles(1)
->required()
->translateLabel()
->openable()
->downloadable()
->collection('images')
->disk(config('media-library.disk_name'))
->multiple()
->reorderable()
->maxFiles(5),
])
->color('gray')
->action(function (array $data) {
//TODO save data and uploaded file spatie media
$a = 2;
})
->icon('heroicon-o-clipboard-document-check')
1 replies