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;
                    }),


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!
Was this page helpful?