config/broadcast.py
configuration file. For now there is one driver available Pusher.pusher
python packagenpm install pusher-js
and then import Pusher class with import Pusher from 'pusher-js';
.MIX_
.CanBroadcast
. You may use any class, including the Masonite Event classes.UserAdded
.Broadcast
facade or by resolving Broadcast
class from container.private-
prefix. When using private channels, the prefix will be prepended for you automatically.private-channel_name
channel./broadcasting/authorize
but you can change this to anything you like:/pusher/user-auth
by default. If you want to change this client-side you can do it when creating Pusher instance/pusher/user-auth
route to the CSRF exemption.1
will be able to authenticate to channel private-1
, user with ID 2
to channel private-2
and so on.Broadcast.routes()
from your routes and add your own routepresence-channel_name
channel.NewRelease
Broadcast event and trigger this event from the backend.releases
channel and subscribe to NewRelease
events to display an alert box with the release message.basic
and admin
and that we want to send alerts to admin users only. The basic users should not be authorized to subscribe to the alerts.private-admins
AdminUserAlert
Broadcast eventprivate-admins
channel and subscribe to AdminUserAlert
events to display an alert box with the message.