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).
As you may know, I’ve been working on my first NPM package which is simply a SQL Builder and converts the method calls into a SQL string (specifically MySQL at present, but that should include others in the future). The reason I’ve been working on this, is partly to improve my NodeJs skills, and partly because of an idea I’ve been having for a ORM that is hopefully as easy to use as Active Record but has more of a Data Mapper design.
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.