© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
4 replies
Hapoo

Filter enum value from select enum options (get all enum values but selected ones)

Hey everyone, I have a repeater for some attributes of same table, to be able to store multiple data using
handleRecordCreation
handleRecordCreation
method

one of the repeated attribute is
car_type
car_type
which is a select options using
CarType::class
CarType::class
enum, so I don't want to display an option that I already used in a previous repeater, do you know how I achieve that?

Forms\Components\Select::make('car_type')
                ->translateLabel()
                ->enum(CarType::class)
                // ->options(CarType::class)
                ->options(function (Forms\Get $get) {
                    $carType = $get('car_type');
                    info($carType);
                    //remove $carType from returned CarType::class
                    return CarType::class;
                })
                ->live()
Forms\Components\Select::make('car_type')
                ->translateLabel()
                ->enum(CarType::class)
                // ->options(CarType::class)
                ->options(function (Forms\Get $get) {
                    $carType = $get('car_type');
                    info($carType);
                    //remove $carType from returned CarType::class
                    return CarType::class;
                })
                ->live()


Thanks in advance!
image.png
Solution
https://filamentphp.com/docs/3.x/forms/fields/repeater#disabling-options-when-they-are-already-selected-in-another-item
?
Repeater - Form Builder - Filament
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

Dynamic select options doesnt remember selected value
FilamentFFilament / ❓┊help
8mo ago
Remove All From Select Filter
FilamentFFilament / ❓┊help
8mo ago
How to filter select option from another select value
FilamentFFilament / ❓┊help
3y ago