© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•8mo ago•
7 replies
ahinkle

Filtering Enum Options

How would one filter enum options? I don't want to include all enum options; only a subset.

ToggleButtons::make('recipient')
    ->options([
        Party::OWNER,
        Party::TENANT,
    ])
ToggleButtons::make('recipient')
    ->options([
        Party::OWNER,
        Party::TENANT,
    ])


This gives an exception:
Filament\Forms\Components\ToggleButtons::isOptionDisabled(): Argument #2 ($label) must be of type string, App\Enums\Party given
Filament\Forms\Components\ToggleButtons::isOptionDisabled(): Argument #2 ($label) must be of type string, App\Enums\Party given


I've seen seen the option,
disableOptionWhen
disableOptionWhen
, but I don't want to disable the option, I want to hide it entirely from view.

Additionally, I can always do a rigmarole of
collection(..enum)->filter
collection(..enum)->filter
within
options
options
but that will eliminate icons, colors, and labels defined in the enum.
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

Filtering options in RelationManager
FilamentFFilament / ❓┊help
3y ago
Filtering select options on-fly
FilamentFFilament / ❓┊help
2y ago
Right way to exclude specific enum options within ->options?
FilamentFFilament / ❓┊help
11mo ago
Select disableOptionsWhenSelectedInSiblingRepeaterItems fails when options are Enum
FilamentFFilament / ❓┊help
2y ago