dispatchBrowserEvent()has been renamed todispatch() All event parameters must be named For more information, check out the newevents documentation page. Here are the “find and replace” differences that should be applied to your application: ...
-$this->dispatchBrowserEvent('post-created'); +$this->dispatch('post-created'); -$this->dispatchBrowserEvent('post-created', ['postId' => $post->id]); +$this->dispatch('post-created', postId: $post->id); -... +... -... +... -.....
Livewire allows you to fire browser window events like so: 1$this->dispatchBrowserEvent('name-updated',['newName'=>$value]); You are able to listen for this window event with JavaScript: 1 2window.addEventListener('name-updated', event =>{ 3alert('...
You might want to read the upgrade guide or the documentation for Livewire v3 events, the method has been changed from emit and dispatchBrowserEvent to dispatch:Copy // Livewire v2 $this->emit('refresh'); // Livewire v3 $this->dispatch('refresh'); 11...
public function showToast($field) { $this->dispatchBrowserEvent('open-toast'); } // ... // Rest of your Livewire component } So, now whenever any livewire property updates, the 'updated' event fires, calling showToast method which dispatches a browser event called open-toast. This event...
$this->dispatchBrowserEvent('swal:modal', [ 'type' => 'success', 'title' => 'Your account has been created', 'text' => 'First step has been completed successfully!', ]); $this->reset(); return redirect()->route('login'); } ...