SelectFilter with options from custom query
I am trying to show a SelectFilter for possible values of a specific column. I tried using the options() method and passing an Eloquent query in a local copy of the Filament demo application, like so: `
Got the idea of this approach from https://filamentphp.com/tricks/filter-by-multiple-spatie-tags.
It is working a expected but in Debugbar i see a bunch of database requests. Normally executing one should be enough to fill the SelectFilter.
Looks like every Trait (HasActions, HasBulkActions,...) is triggering it. Am I missing something? Doing So many requests is not really a solution at the moment.
3 Replies