Filament Forms
In the last work diary, I covered how easy it was to link select fields … where values of select B are dependant on the value of select A.
When you get an excessive amount of options though its nice to add a searchable field:
Forms\Components\Select::make('venue_id')
->searchable()
->preload()
So easy!
But Filament gets even better.
You can add an inline form to the select!
->createOptionForm(Venue::getForm())
->editOptionForm(Venue::getForm())
The getForm function simply returns an array of form elements like you would get in the normal filament resource files.
The amount of work this saves the developer is crazy good.
Filament is really very good at first glance although I’ve noticed some very minor bugs.
Leave a Reply