© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•13mo ago•
9 replies
Señor Nikola

Dispatch Event on AfterStateUpdated()

Hello,

Does anyone know how to dispatch event for example to update-counter within main resource? Like we have $this->dispatch in Livewire components and in List,Edit filament classes, I need kind-a same thing but within main resource..

protected static function getStatusColumn (): Tables\Columns\SelectColumn
    {
        return Tables\Columns\SelectColumn::make('status')
            ->label(__("inputs.status"))
            ->options(ContactFormStatuses::class)
            ->sortable()
            ->afterStateUpdated(function($record)  {
                Notification::make()
                    ->title(__('notifications.status_updated'))
                    ->success()
                    ->send();
                $this->dispatch('update-counter');
            })
            ->visible(fn() => self::$user->can('view_status' . self::RESOURCE_PERMISSION_SUFFIX));
    }
protected static function getStatusColumn (): Tables\Columns\SelectColumn
    {
        return Tables\Columns\SelectColumn::make('status')
            ->label(__("inputs.status"))
            ->options(ContactFormStatuses::class)
            ->sortable()
            ->afterStateUpdated(function($record)  {
                Notification::make()
                    ->title(__('notifications.status_updated'))
                    ->success()
                    ->send();
                $this->dispatch('update-counter');
            })
            ->visible(fn() => self::$user->can('view_status' . self::RESOURCE_PERMISSION_SUFFIX));
    }
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 from afterStateUpdated to another field?
FilamentFFilament / ❓┊help
11mo ago
Dispatch event not working on action
FilamentFFilament / ❓┊help
3y ago
Database Notifications Event Dispatch
FilamentFFilament / ❓┊help
4mo ago
404 after dispatch livewire event
FilamentFFilament / ❓┊help
13mo ago