Β© 2026 Hedgehog Software, LLC
Action::make('switchTeam') ->label(__('Switch team')) ->icon('heroicon-s-arrow-right-circle') ->color('gray') ->action(function (Team $team) { // Something happens here }) ->dispatch( 'switchedTeam' )
protected $listeners = [ 'switchedTeam' => 'fireEvent', ];
#[On('switchedTeam')] public function fireEvent() { Log::info('fireEvent'); }
->action(function (Team $team) { //action here }) ->after(fn ($livewire) => $livewire->dispatch('switchedTeam'))
use Livewire\Attributes\On; #[On('switchedTeam')] public function fireEvent() { Log::info('fireEvent'); }