You don't specify how your using the components (i.e. nested or not). I've put your code in an example as non-nested components and things work.
Check it out at this sandbox https://wirebox.app/b/xege2
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm having problem with dispatching event from one component to another this is my code:
// views/livewire/component-a.blade.php
<div>
Button from component A to dispatch an event to component B
<button wire:click="test">Send</button>
</div>
// app/Http/Livewire/ComponentA.php
<?php
namespace App\Livewire;
use Livewire\Component;
class ComponentA extends Component
{
public function test()
{
$this->dispatch('request-account');
}
public function render()
{
return view('livewire.component-a');
}
}
// app/Http/Livewire/ComponentB.php
<?php
namespace App\Livewire;
use Livewire\Component;
use Livewire\Attributes\On;
class ComponentB extends Component
{
#[On('request-account')]
public function account() {
dd('hello');
}
public function render()
{
return view('livewire.component-b');
}
}
When I click the button to dispatch the event nothing happens! This is a Laravel fresh project with the latest livewire 3 What am I doing wrong I'm out of ideas.. Console is empty and nothing happens on the network tab when I click the button.
Please or to participate in this conversation.