kmnurunnabi's avatar

Laravel Notification with Broadcasting

I am currently building an social application where I have a requirement of In-App notification with realtime broadcasting. I have read something in laravel broadcast notifications section. But I am not sure about what is it mean. Is that mean broadcasting with database notification or any of others?

0 likes
1 reply
s4muel's avatar

i think the documentation is pretty straightforward: https://laravel.com/docs/10.x/broadcasting#introduction

anyway, you need two parties:

  • broadcaster - lives on backend and emits an event, for example to pusher, see alternatives in documentation) you basically can emit/broadcast any message, not just database notification. your backend script simply writes to pusher channel, where receiver can get it
  • receiver - something on the front-end side which connects to the service (pusher in our example) and handles the messages. for this purpose laravel has a package called echo (js library) to make it easier.
1 like

Please or to participate in this conversation.