Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

laravel-echo

Package Overview
Dependencies
Maintainers
1
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

laravel-echo

Laravel Echo library for beautiful Pusher and Socket.IO integration

  • 1.17.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
168K
decreased by-0.2%
Maintainers
1
Weekly downloads
 
Created

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

Keywords

FAQs

Package last updated on 26 Nov 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc