© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
21 replies
Shaung Bhone

Advanced - Form Builder

Could you please help me understand why selecting a company name in my app results in a blank page when I use the reactive() and afterStateUpdated() methods? Your insights would be greatly appreciated. There is no error in my browser console.

Forms\Components\Select::make('company_id')
    ->options(\App\Models\Company::all()->pluck('name', 'id'))
    ->searchable()
    ->reactive()
    ->afterStateUpdated(fn (callable $set) => $set('location_id', null))

Forms\Components\Select::make('location_id')
    ->label('Location')
    ->options(function (callable $get) {
        $company = \App\Models\Company::find($get('company_id'));
        if (! $company) {
            return \App\Models\Location::all()->pluck('name', 'id');
        }

        return $company->locations->pluck('name', 'id');
    })
    ->string()
    ->searchable()
    ->required(),
Forms\Components\Select::make('company_id')
    ->options(\App\Models\Company::all()->pluck('name', 'id'))
    ->searchable()
    ->reactive()
    ->afterStateUpdated(fn (callable $set) => $set('location_id', null))

Forms\Components\Select::make('location_id')
    ->label('Location')
    ->options(function (callable $get) {
        $company = \App\Models\Company::find($get('company_id'));
        if (! $company) {
            return \App\Models\Location::all()->pluck('name', 'id');
        }

        return $company->locations->pluck('name', 'id');
    })
    ->string()
    ->searchable()
    ->required(),

I noticed that this occurred after upgrading to Filament v3 on a different branch.
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

Advanced Nested Relationship Form builder
FilamentFFilament / ❓┊help
16mo ago
advanced form
FilamentFFilament / ❓┊help
3y ago
form builder
FilamentFFilament / ❓┊help
2y ago
form builder
FilamentFFilament / ❓┊help
3y ago