© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Jon Mason

Toggle afterStateUpdated not getting fired

public function form(Form $form): Form
    {
        return $form->schema([
            Toggle::make('showUnmatched')
                ->label('Show')
                ->onColor('primary')
                ->offColor('gray')
                ->afterStateUpdated(function (?string $state, ?string $old) {
                    Log::debug($state);
                    Log::debug($old);
                })
        ]);
    }
public function form(Form $form): Form
    {
        return $form->schema([
            Toggle::make('showUnmatched')
                ->label('Show')
                ->onColor('primary')
                ->offColor('gray')
                ->afterStateUpdated(function (?string $state, ?string $old) {
                    Log::debug($state);
                    Log::debug($old);
                })
        ]);
    }


I don't get anything logged when I use the
afterStateUpdated
afterStateUpdated
method. I'dl ike to be able to save the state in the session but it doesn't seem to be getting fired at all. Suggestions? It's not tied to a field in my database, it's just a toggle I'm using to show/hide a section on the page.
Solution
add
->live()
->live()
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Toggle Input afterStateUpdated not doing anything
FilamentFFilament / ❓┊help
2y ago
Toggle afterStateUpdated call action
FilamentFFilament / ❓┊help
3y ago
afterStateUpdated in toggle in a custom component not firering
FilamentFFilament / ❓┊help
14mo ago
Toggle component afterStateUpdated event does not fire on false
FilamentFFilament / ❓┊help
3y ago