LaravelPackages.net
Acme Inc.
Toggle sidebar
hjbdev/laravel-pusher-batch-auth

A package to support the dirkbonhomme/pusher-js-auth npm package

216
1
1.0.1
About hjbdev/laravel-pusher-batch-auth

hjbdev/laravel-pusher-batch-auth is a Laravel package for a package to support the dirkbonhomme/pusher-js-auth npm package. It currently has 1 GitHub stars and 216 downloads on Packagist (latest version 1.0.1). Install it with composer require hjbdev/laravel-pusher-batch-auth. Discover more Laravel packages by hjbdev or browse all Laravel packages to compare alternatives.

Last updated

Laravel Pusher Batch Auth

Package to give support for dirkbonhomme/pusher-js-auth into Laravel.

Latest Version on Packagist Total Downloads

composer require hjbdev/laravel-pusher-batch-auth

Registers the /broadcasting/auth/batch route, send your auth requests there instead.

// routes/web.php
Route::pusherBatchAuth();

You may need to add an exemption in your app/Http/Middleware/VerifyCsrfToken.php for this route.

protected $except = [
    'broadcasting/auth/batch'
];

Example:

import Echo from 'laravel-echo';
import Pusher from 'pusher-js';
import PusherBatchAuthorizer from 'pusher-js-auth';

const echo = new Echo({
    broadcaster: 'pusher',
    client: new Pusher(process.env.MIX_PUSHER_APP_KEY, {
        authEndpoint: '/broadcasting/auth/batch',
        authorizer: PusherBatchAuthorizer,
        authDelay: 500,
        forceTLS: true,
        cluster: process.env.MIX_PUSHER_APP_CLUSTER,
    }),
});

Star History Chart