You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP

laravel-echo

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
e

laravel-echo

Laravel Echo library for beautiful Pusher and Socket.IO integration

2.1.6
latest
77

Supply Chain Security

100

Vulnerability

72

Quality

86

Maintenance

100

License

Version published
Weekly downloads
255K
3.7%
Maintainers
1
Weekly downloads
 
Created
Issues
4

What is laravel-echo?

Laravel Echo is a JavaScript library that makes it easy to work with WebSockets in a Laravel application. It provides a simple API for subscribing to channels and listening for events broadcast by your Laravel application.

What are laravel-echo's main functionalities?

Subscribing to Channels

This feature allows you to subscribe to a public channel and listen for events. In this example, the client subscribes to the 'orders' channel and listens for the 'OrderShipped' event.

Echo.channel('orders').listen('OrderShipped', (e) => { console.log(e.order); });

Private Channels

This feature allows you to subscribe to private channels that require authentication. In this example, the client subscribes to a private 'orders' channel specific to a user and listens for the 'OrderShipped' event.

Echo.private('orders.' + userId).listen('OrderShipped', (e) => { console.log(e.order); });

Presence Channels

Presence channels build on the concept of private channels and allow you to track the presence of users in a channel. In this example, the client joins a 'chat' room and logs the users currently in the room, as well as users joining and leaving.

Echo.join('chat.' + roomId).here((users) => { console.log(users); }).joining((user) => { console.log(user.name); }).leaving((user) => { console.log(user.name); });

Notifications

This feature allows you to listen for notifications sent to a user. In this example, the client subscribes to a private channel for a specific user and listens for notifications.

Echo.private('App.User.' + userId).notification((notification) => { console.log(notification.type); });

Other packages similar to laravel-echo

FAQs

Package last updated on 17 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts