© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
7 replies
Gaspar

enum value in Forms\Components\Select

My enum labels shows both as Select element value and label.

Using Filament docs example here as a base.
enum Status: string implements HasLabel
{
    case DRAFT = 'My draft label';    
    public function getLabel(): ?string
    {
        return $this->name;
    }
}
enum Status: string implements HasLabel
{
    case DRAFT = 'My draft label';    
    public function getLabel(): ?string
    {
        return $this->name;
    }
}

Select::make('status')
    ->options(Status::class)
Select::make('status')
    ->options(Status::class)

It produces:
<option value="My draft label">My draft label</option>
<option value="My draft label">My draft label</option>

I'd like to have:
<option value="DRAFT">My draft label</option>
<option value="DRAFT">My draft label</option>

How to "fix" this?
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

\Forms\Components\Select
FilamentFFilament / ❓┊help
5mo ago
Run Forms\Components\Select::..->options(..) after another Forms\Components\Select filled
FilamentFFilament / ❓┊help
3y ago
Filament\Forms\Components\Select::isOptionDisabled():
FilamentFFilament / ❓┊help
3y ago
Filter enum value from select enum options (get all enum values but selected ones)
FilamentFFilament / ❓┊help
2y ago