© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•11mo ago•
3 replies
EpicKau

Dispatch event from afterStateUpdated to another field?

Hey guys, I have a builder field with a afterStateUpdated function where I want to dispatch the current value to a custom field. I tryed livewire listener but this didnt worked.

Is this possible? Or could I force a rerender of the custom field by manipulating its state?

Thanks.

Builder::make('content')
->blocks(
PageBlocks::make())
->live()
->afterStateUpdated(function(Get $get, Set $set, Livewire $livewire) {
  $livewire->dispatch('updateData', $get('content'));
  $set('preview', $get('content'));
}),
Builder::make('content')
->blocks(
PageBlocks::make())
->live()
->afterStateUpdated(function(Get $get, Set $set, Livewire $livewire) {
  $livewire->dispatch('updateData', $get('content'));
  $set('preview', $get('content'));
}),


    #[On('updateData')]
    public function updateData(array $data)
    {
        dd($data);
    }
    #[On('updateData')]
    public function updateData(array $data)
    {
        dd($data);
    }
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

Dispatch Event on AfterStateUpdated()
FilamentFFilament / ❓┊help
13mo ago
Unable to dispatch/listen event from Action
FilamentFFilament / ❓┊help
3y ago
watchout when afterStateUpdated from another component
FilamentFFilament / ❓┊help
13mo ago
How to dispatch an event from an Action
FilamentFFilament / ❓┊help
16mo ago