© 2026 Hedgehog Software, LLC

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

Why select multiple is always searchable?

in my users table i have set this select for when i create a new user (modal):
Select::make('roles')
    ->multiple()
    ->relationship('roles', 'name')
    ->options(function () {
        return Role::query()
            ->when(! auth()->user()->hasRole('Superadmin'), function ($q) {
                $q->where('name', '!=', 'Superadmin');
            })
            ->pluck('name', 'id')
            ->map(function ($caseName) {
                return __($caseName);
            })
            ->toArray()
        ;
    })
    ->label(__('Roles'))
    ->searchable(false)
,
Select::make('roles')
    ->multiple()
    ->relationship('roles', 'name')
    ->options(function () {
        return Role::query()
            ->when(! auth()->user()->hasRole('Superadmin'), function ($q) {
                $q->where('name', '!=', 'Superadmin');
            })
            ->pluck('name', 'id')
            ->map(function ($caseName) {
                return __($caseName);
            })
            ->toArray()
        ;
    })
    ->label(__('Roles'))
    ->searchable(false)
,


im trying to set -
->searchable(false)
->searchable(false)
, but it is always searchable anyways. how to disable the search in a select multiple???
Solution
final code:
Select::make('roles')
    ->multiple()
    ->relationship('roles', 'name')
    ->options(function () {
        return Role::query()
            ->when(! auth()->user()->hasRole('Superadmin'), function ($q) {
                $q->where('name', '!=', 'Superadmin');
            })
            ->pluck('name', 'id')
            ->map(function ($caseName) {
                return __($caseName);
            })
            ->toArray()
        ;
    })
    ->label(__('Roles'))
    ->preload()
,
Select::make('roles')
    ->multiple()
    ->relationship('roles', 'name')
    ->options(function () {
        return Role::query()
            ->when(! auth()->user()->hasRole('Superadmin'), function ($q) {
                $q->where('name', '!=', 'Superadmin');
            })
            ->pluck('name', 'id')
            ->map(function ($caseName) {
                return __($caseName);
            })
            ->toArray()
        ;
    })
    ->label(__('Roles'))
    ->preload()
,
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Select searchable and multiple
FilamentFFilament / ❓┊help
10mo ago
Select::make multiple, searchable
FilamentFFilament / ❓┊help
3y ago
Select Multiple always active
FilamentFFilament / ❓┊help
2y ago
multiple() & searchable() stops Select from working.
FilamentFFilament / ❓┊help
2y ago