© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
Wannes

SelectFilter with null

I also need a check of null on my SelectFilter (its a nullable property)

`
SelectFilter::make('assigned_to')
                    ->multiple()
                    ->options(function () {
                        $users = \App\Models\User::all();
                        $options = $users->pluck('name', 'id')->toArray();
                        $options = array_merge([null => 'Unassigned'], $options);
                        return $options;
                    }),
`
SelectFilter::make('assigned_to')
                    ->multiple()
                    ->options(function () {
                        $users = \App\Models\User::all();
                        $options = $users->pluck('name', 'id')->toArray();
                        $options = array_merge([null => 'Unassigned'], $options);
                        return $options;
                    }),


So I want to select on unassigned, and that's when the value is null. How can I do this? The code above doesn't work.

Thx!
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

Filter null values using SelectFilter
FilamentFFilament / ❓┊help
2y ago
SelectFilter Add Null as an option
FilamentFFilament / ❓┊help
9mo ago
SelectFilter: Filter by value, null or any
FilamentFFilament / ❓┊help
3y ago
SelectFilter with relationship help...
FilamentFFilament / ❓┊help
2y ago