© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
Soundmit

Filtering ENUMS in option list

i have this options list
->form([
                                Forms\Components\Radio::make('type')
                                    ->label('Type')
                                    ->default('regular')
                                    ->options(PrintOptions::class)
                            ])
->form([
                                Forms\Components\Radio::make('type')
                                    ->label('Type')
                                    ->default('regular')
                                    ->options(PrintOptions::class)
                            ])

i want to hide 2 options if the $record->parts is null
this is my enum
enum PrintOptions: string implements HasLabel
{
    case REGULAR = 'regular';
    case AGGREGATE = 'aggregate';
    case LABEL = 'label';
    case RECEIPT = 'receipt';
    case DATAAUTH = 'authorization';
 
    public function getLabel(): ?string
    {
        return match ($this) {
            self::REGULAR => 'regular',
            self::AGGREGATE => 'aggregate',
            self::LABEL => 'label',
            self::RECEIPT => 'receipt',
            self::DATAAUTH => 'Data authorization',

        };
    }
}
enum PrintOptions: string implements HasLabel
{
    case REGULAR = 'regular';
    case AGGREGATE = 'aggregate';
    case LABEL = 'label';
    case RECEIPT = 'receipt';
    case DATAAUTH = 'authorization';
 
    public function getLabel(): ?string
    {
        return match ($this) {
            self::REGULAR => 'regular',
            self::AGGREGATE => 'aggregate',
            self::LABEL => 'label',
            self::RECEIPT => 'receipt',
            self::DATAAUTH => 'Data authorization',

        };
    }
}

i want to hide REGULAR and AGGREGATE
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

Select List Option Colouring?
FilamentFFilament / ❓┊help
3y ago
Use ENUMS in controller
FilamentFFilament / ❓┊help
2y ago
Filtering options in RelationManager
FilamentFFilament / ❓┊help
3y ago