laravel-echo

  • Version 1.11.3
  • Published
  • 190 kB
  • No dependencies
  • MIT license

Install

npm i laravel-echo
yarn add laravel-echo
pnpm add laravel-echo

Overview

Laravel Echo library for beautiful Pusher and Socket.IO integration

Index

Classes

class Echo

class Echo {}
  • This class is the primary API for interacting with broadcasting.

constructor

constructor(options: any);
  • Create a new class instance.

property connector

connector: any;
  • The broadcasting connector.

property options

options: any;
  • The Echo options.

method channel

channel: (channel: string) => Channel;
  • Get a channel instance by name.

method connect

connect: () => void;
  • Create a new connection.

method disconnect

disconnect: () => void;
  • Disconnect from the Echo server.

method encryptedPrivate

encryptedPrivate: (channel: string) => Channel;
  • Get a private encrypted channel instance by name.

method join

join: (channel: string) => PresenceChannel;
  • Get a presence channel instance by name.

method leave

leave: (channel: string) => void;
  • Leave the given channel, as well as its private and presence variants.

method leaveChannel

leaveChannel: (channel: string) => void;
  • Leave the given channel.

method listen

listen: (channel: string, event: string, callback: Function) => Channel;
  • Listen for an event on a channel instance.

method private

private: (channel: string) => Channel;
  • Get a private channel instance by name.

method registerAxiosRequestInterceptor

registerAxiosRequestInterceptor: () => void;
  • Register an Axios HTTP interceptor to add the X-Socket-ID header.

method registerInterceptors

registerInterceptors: () => void;
  • Register 3rd party request interceptiors. These are used to automatically send a connections socket id to a Laravel app with a X-Socket-Id header.

method registerjQueryAjaxSetup

registerjQueryAjaxSetup: () => void;
  • Register jQuery AjaxPrefilter to add the X-Socket-ID header.

method registerVueRequestInterceptor

registerVueRequestInterceptor: () => void;
  • Register a Vue HTTP interceptor to add the X-Socket-ID header.

method socketId

socketId: () => string;
  • Get the Socket ID for the connection.

Package Files (1)

Dependencies (0)

No dependencies.

Dev Dependencies (20)

Peer Dependencies (0)

No peer dependencies.

Badge

To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/laravel-echo.

  • Markdown
    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/laravel-echo)
  • HTML
    <a href="https://www.jsdocs.io/package/laravel-echo"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>