Is there a way to pass a query builder into searchable select to populate options?
I'm new to filament, it seems like there would be a way to pass in a custom query builder into a select component instead of being dependent on a relationship set up on a model. Is there a way to do this instead of having to fetch all of the options in advance?
5 Replies
That works for small data sets, but what if you don't want to return all of the available data to the browser? Instead, I'm looking to have the user to filter the select down by a search driven via an eloquent query.
Solution
->searchable()
->getSearchResultsUsing( callback )
and you can try passing parameters from other fields with $get to build your select
https://filamentphp.com/docs/3.x/forms/advanced#injecting-the-state-of-another-field
Thank you!