Ably Broadcaster is a Laravel package by Matthew Hall that adds support for the Ably real-time messaging service. Backed by the Ably PHP SDK, this package adds a custom Laravel broadcast driver.
You can use this broadcast driver as an alternative to Pusher, which is fantastic that Laravel developers have more choices when it comes to real-time messaging.
After you complete the setup found in the readme, the frontend keeps using the Pusher JS library, but you’ll use the Ably WebSocket host:
1import Echo from "laravel-echo" 2 3window.Pusher = require('pusher-js'); 4 5window.Echo = new Echo({ 6 broadcaster: 'pusher', 7 key: process.env.MIX_ABLY_KEY, 8 wsHost: 'realtime-pusher.ably.io', 9 wsPort: 443,10 disableStats: true,11 encrypted: true,12});
This package works with public, private, and presence channels. You can check out this package on GitHub at springboardVR/Laravel-Ably-Broadcaster.
0 comments:
Post a Comment
Thanks