© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
7 replies
ImShehryar

Make default select option other than the disabled option

how to make a default option other than the disabled option.
Select::make('status')
    ->options($this-options)
    ->default(array_key_first($this->options))
    ->disableOptionWhen(fn (string $value): bool => $value === 'option1')

$options = [
    'option1' => 'Option 1', // suppose this is disabled option
    'option2' => 'Option 2',
    'option3' => 'Option 3',
    'option4' => 'Option 4',
    'option5' => 'Option 5',
];
Select::make('status')
    ->options($this-options)
    ->default(array_key_first($this->options))
    ->disableOptionWhen(fn (string $value): bool => $value === 'option1')

$options = [
    'option1' => 'Option 1', // suppose this is disabled option
    'option2' => 'Option 2',
    'option3' => 'Option 3',
    'option4' => 'Option 4',
    'option5' => 'Option 5',
];
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

Default option for select filter
FilamentFFilament / ❓┊help
16mo ago
Disable Select Filter Default "All" Option
FilamentFFilament / ❓┊help
2y ago
Select filter - remove/disable default option
FilamentFFilament / ❓┊help
3y ago
Select Option Disabled Based on Another Field's Value
FilamentFFilament / ❓┊help
12mo ago