Level 50
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