© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
KinBH

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()
]);
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

FileUpload with dynamic folder name
FilamentFFilament / ❓┊help
3y ago
Dynamic selectablePlaceholder closure does not have the desired effect
FilamentFFilament / ❓┊help
4mo ago
FileUpload directory closure
FilamentFFilament / ❓┊help
3y ago
FilamentPHP closure definition
FilamentFFilament / ❓┊help
3y ago