A no configuration pay as you go broadcasting websocket solution for Laravel applications.
Setup
Include the broadcast driver:
composer require larasocket/larasocket-driver
Add Larasocket as a broadcasting connection option in config/broadcasting.php
:
'larasocket' => [
'driver' => 'larasocket',
'token' => env('LARASOCKET_TOKEN'),
],
Update your .env
:
BROADCAST_DRIVER=larasocket
LARASOCKET_TOKEN=<token>
MIX_LARASOCKET_TOKEN="${LARASOCKET_TOKEN}"
Include the Larasocket client library:
npm i larasocket-js
Update your Echo configuration in bootstrap.js
:
import Echo from 'laravel-echo';
import Larasocket from 'larasocket-js';
window.Echo = new Echo({
broadcaster: Larasocket,
token: process.env.MIX_LARASOCKET_TOKEN,
});
Pricing
Contact
©Larasocket. All rights reserved.