No synthesizer found for key: "" on FileUpload

Hello I just started filament and laravel one week ago, dans I'm facing this error when I try to upload a file using FileUpload. this is my code : Forms\Components\FileUpload::make("{$eye}_pdf") ->label('Fichier PDF') ->directory('patients') ->hidden(fn ($get) => !self::isFieldVisible($eye, 'pdf', $get)), Thank you for your help
10 Replies
Nashoba
NashobaOP6d ago
I also change the disk in config to local instead of public
toeknee
toeknee6d ago
remove the {eye} from the file name does that help? It\s usually due to the default value of the property however, needing to be null not ''
Nashoba
NashobaOP6d ago
yes it fixes it, thanks for your help, I'll find another way to put this variable
toeknee
toeknee6d ago
Forms\Components\FileUpload::make($eye."_pdf")
Forms\Components\FileUpload::make($eye."_pdf")
Nashoba
NashobaOP6d ago
Nope it doesn't work Same error as the beginning
toeknee
toeknee6d ago
Then $eye is not defined properly. try
Forms\Components\FileUpload::make(\Str::slug($eye)."_pdf")
Forms\Components\FileUpload::make(\Str::slug($eye)."_pdf")
Nashoba
NashobaOP6d ago
I have this : ->tabs([ self::generateEyeTab('left'), self::generateEyeTab('right'), ]) with : protected static function generateEyeTab(string $eye): Forms\Components\Tabs\Tab I don't know if it's the right way to do it In my generateEyeTab I have then my FileUpload
toeknee
toeknee6d ago
I dunno I'd need to see the whole code that renders the FileUpload
toeknee
toeknee6d ago
looks like it should be good tbh

Did you find this page helpful?