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:
SelectFilter::make('name')->options(Product::all()->pluck('name', 'name'))
`
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.
Bildschirmfoto_2023-06-21_um_15.46.58.png
Bildschirmfoto_2023-06-21_um_15.53.11.png
Was this page helpful?