© 2026 Hedgehog Software, LLC

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

Disable select by evaluating if another input value is null or not

I'm trying, on Filament V2, to disable/enable select by evaluating another input if it's nulled or not, but seems like when I populate the company_id select, the second doesn't enable.

Where i'm wrong?

                    Select::make('company_id')
                        ->relationship('company', 'legal_name')
                        ->searchable(['legal_name', 'vat_number'])
                        ->preload()
                        ->label('Azienda destinataria'),
                    Select::make('company_contact_id')
                        ->relationship('company_contact', 'full_name', fn (Builder $query, $get) => $query->where('company_id', $get('company_id')))
                        ->searchable(['name', 'surname', 'email'])
                        ->preload()
                        ->label('Referente aziendale')
                        ->disabled(fn ($get) => $get('company_id') == null)
                        ->required()]),
                    Select::make('company_id')
                        ->relationship('company', 'legal_name')
                        ->searchable(['legal_name', 'vat_number'])
                        ->preload()
                        ->label('Azienda destinataria'),
                    Select::make('company_contact_id')
                        ->relationship('company_contact', 'full_name', fn (Builder $query, $get) => $query->where('company_id', $get('company_id')))
                        ->searchable(['name', 'surname', 'email'])
                        ->preload()
                        ->label('Referente aziendale')
                        ->disabled(fn ($get) => $get('company_id') == null)
                        ->required()]),
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

formatStateUsing not called if value is null
FilamentFFilament / ❓┊help
3y ago
Select input value not being set
FilamentFFilament / ❓┊help
2y ago
1 Select input depends on another Select input's value. Select's options populated by DB table's col
FilamentFFilament / ❓┊help
2y ago
SelectFilter: Filter by value, null or any
FilamentFFilament / ❓┊help
3y ago