© 2026 Hedgehog Software, LLC

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

Remove the item selected in another select

I tried this but it deson't work
Group::make([
                    Forms\Components\Select::make('from_id')
                        ->relationship('from', fn (Builder $query, Get $get) => $query->where('id', '!=', $get('to_id')))
                        ->getOptionLabelFromRecordUsing(fn (Model $record) => "{$record->holder->name}")
                        ->preload()
                        ->searchable()
                        ->required()
                        ->live(onBlur: true),
                    Forms\Components\Select::make('to_id')
                        ->relationship('from', fn (Builder $query, Get $get) => $query->where('id', '!=', $get('from_id')))
                        ->getOptionLabelFromRecordUsing(fn (Model $record) => "{$record->holder->name}")
                        ->preload()
                        ->searchable()
                        ->required()
                        ->live(onBlur: true),
                ])->columns(2),
Group::make([
                    Forms\Components\Select::make('from_id')
                        ->relationship('from', fn (Builder $query, Get $get) => $query->where('id', '!=', $get('to_id')))
                        ->getOptionLabelFromRecordUsing(fn (Model $record) => "{$record->holder->name}")
                        ->preload()
                        ->searchable()
                        ->required()
                        ->live(onBlur: true),
                    Forms\Components\Select::make('to_id')
                        ->relationship('from', fn (Builder $query, Get $get) => $query->where('id', '!=', $get('from_id')))
                        ->getOptionLabelFromRecordUsing(fn (Model $record) => "{$record->holder->name}")
                        ->preload()
                        ->searchable()
                        ->required()
                        ->live(onBlur: true),
                ])->columns(2),
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

Disable select option if selected in another repeater item
FilamentFFilament / ❓┊help
3y ago
Remove "remove item" on select
FilamentFFilament / ❓┊help
2y ago
Repeater remove selected option in a select
FilamentFFilament / ❓┊help
3y ago
Changing Selected Item background and text color in Select input
FilamentFFilament / ❓┊help
15mo ago