Laravel

Livewire Events: Component Communication

December 24, 2025 1 min read 12 views

Communicate between Livewire components:

Emit Events

$this->emit('postCreated', $post->id);

Listen to Events

protected $listeners = ['postCreated' => 'refreshList'];

public function refreshList($postId)
{
    $this->posts = Post::all();
}

Emit to Specific Component

$this->emitTo('notifications', 'show', 'Post created!');

Browser Events

$this->dispatchBrowserEvent('alert', ['message' => 'Success!']);
Share this post:

Related Posts

Comments (0)

Please log in to leave a comment. Log in

No comments yet. Be the first to comment!