In this tutorial I’m going to walk you through a feature I’m implementing on a new project which involves async actions and Realtime Updates in Laravel. The feature is generating a screenshot of a website when the user adds a website to the app (more info on the app coming soon).
Well, its been coming and now it’s here. Laravel Echo (no docs link yet). As predicted it’s a pretty neat realtime abstraction currently over the Pusher API (as it’s the easiest to manage authentication), but I think intended generally for any realtime communication mechanism and hopefully it will be in the future.
While immersing myself in NodeJs, and to be fair dabbling with real-time events in PHP (powered by Socket.io and Laravel) I’ve been wondering whats the best way to use bi-direction data flow and the WebSocket Protocol.
The traditional way to produce an app is with REST endpoints and the request/response workflow. Now with NodeJs and WebSockets we can totally invert the universe and use pub/sub to provide data to the UI.