Broadcast event to participants in group using laravel pusher

  laravel, php, pusher, real-time
  • I’m working on a chat application in which user can create a group and other users can join that group, So when the admin user delete the group I want to broadcast an event to the participant of the group.

  • I’ve created an event with method broadcastOn() which return delete-group channel name, but the event is getting broadcast to other users who are not the participant of the group

  • But if I’ll create a channel name like delete-group.GroupId, then on the frontend side I need to listen to all the channel in which user has participated, for-eg: if user participate in n group then I need to listen to n channel of delete zone on frontend side

  • So how can we broadcast the event only to the participants of the group?

Source: Laravel

Leave a Reply