Closure Upload Folder dynamic
How to use dynamic id based on select? Case: upload multiple pictures to one gallery. PS: i need save 1 file per line (file_name | galleryid)
My code:
return $form
->schema([
FileUpload::make('arquivo')
->image()
->maxSize(2048)
->multiple()
->disk('public')
// I need something like this:
// ->directory(function (UploadedFile $file) {
// return "fotos_galeria/{$file->get('galeria_id')}";
->uploadingMessage('Enviando arquivo...'),
Select::make('galeria_id')
->label('Galeria')
->relationship(name: 'galeria', titleAttribute: 'nome')
->searchable()
->preload()
]);
0 Replies