© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago
javalava6985

Set the state of ->afterStateUpdated inside a test

My page shows some text after the user selects a certain entry form a Select::make(). I use the ->afterStateUpdated method to change the text if a certain condition is met. Does anyone know how i can implement this inside a (Pest) test?

The following doesn't work:

$livewire = livewire(CreateReport::class)
->set('client_id', $newReport->client->getKey())
->call('afterStateUpdated', 'client_id'); // Call the afterStateUpdated method if needed

I'm in V3.
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

afterStateUpdated after $set
FilamentFFilament / ❓┊help
3y ago
Repeater afterStateUpdated not returning the old state
FilamentFFilament / ❓┊help
5mo ago
Triggering afterStateUpdated() with $set()?
FilamentFFilament / ❓┊help
17mo ago
How to use $set() Closure to set the state of a fileupload
FilamentFFilament / ❓┊help
3y ago