Source: blog.oussama-mater.me

Laravel Real-Time Notifications with SSE
Say Hi to Server-Sent Events If you've ever needed to implement a real-time feature in your web application, you're likely familiar with the complexity of using WebSockets or the resource-intensive nature of long-polling.

The flow is simple, the client establishes a connection with the server, and the server send updates to the client over that connection as they occur, these updates are sent as "events," which consist of a message and an optional event name. The client then can react to these events accordingly, by displaying a notification or updating the page.

Let's create a new Laravel event php artisan make:event RealTimeNotification
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners