© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
6 replies
morty

What is the difference between these two options on a select filter?

I've seen this done both ways but unsure which to use?

SelectFilter::make('tags')
    ->options(
        fn (): array => Tag::getWithType('crm.accounts')->pluck('name', 'name')->all()
    )
SelectFilter::make('tags')
    ->options(
        fn (): array => Tag::getWithType('crm.accounts')->pluck('name', 'name')->all()
    )


vs

SelectFilter::make('tags')
    ->options(Tag::getWithType('crm.accounts')->pluck('name', 'name'))
SelectFilter::make('tags')
    ->options(Tag::getWithType('crm.accounts')->pluck('name', 'name'))
Solution
🤷‍♂️ nothing

you dont need
->all()
->all()
at all

all
all
if you have some operations on the collection like filtering or additions etc
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Is there a difference between these two `Auth::user()` vs `Filament::auth()->user()`?
FilamentFFilament / ❓┊help
2y ago
Filtering select options on-fly
FilamentFFilament / ❓┊help
2y ago
Select filter grouping options in relation filter
FilamentFFilament / ❓┊help
3y ago
What is the performance difference between `->resources()` and `->discoverResources()`?
FilamentFFilament / ❓┊help
3y ago