DEV Community

Adding real-time updates to your Laravel and Vue apps with laravel-websockets

Andrew Schmelyun on July 21, 2019

Earlier this month I launched listpal.co, a to-do app that included websockets functionality so that each user with the list open would see updates...
Collapse
 
ingjmarquez profile image
jesus marquez • Edited

Hello, your explanation is great, I wanted to ask you a question, instead of updating the whole set of items, only the added item could have been returned from the backend and in which one items could have been items.push (item) ?? ? Your example is very clear, implement the same in angular, thanks!

Collapse
 
blestab profile image
blestab

I am trying this out using lumen and i hit a snag on this step:

php artisan vendor:publish --provider="BeyondCode\LaravelWebSockets\WebSocketsServiceProvider" --tag="migrations"

I get this below output, any ideas on what I could be missing or how i can get around this?

Unable to locate publishable resources.
Publishing complete.

Collapse
 
yellow1912 profile image
yellow1912

It just happens that I'm researching this for my Symfony app as well. There are several options I looked into:

  1. Mercure: default support for Symfony, it's open source but the free version does not support clustering so future growth can be limited.
  2. Pushpin: this looks really interesting because it adds a proxy level on top of traditional app so you can just use Symfony app as you have always done.
  3. Swoole: a php extension that super charge your php and allow it to handle concurrency even better than nodejs. I'm using swoole anyway so this is a viable path.
  4. Nchan: nginx extension to support websocket, long poll, interval poll etc. It is capable of handling huge amount of workload.

At the moment, I'm opting for nchan. Swoole is nice as well but I will have to cook up my own solution so nchan is a battle tested solution. Pushpin is also interesting and it has the paid version that seems reasonable (cheaper than Mercure imo). If I fail with nchan I may go with pushpin.

Collapse
 
msamgan profile image
Mohammed Samgan Khan

Can you please also through some light on the usage of laravel-WebSockets with JQ?

Collapse
 
komalraja profile image
komalraja

Hi, How to display the server data without the event handler in the webpage? .Could you please help?

Collapse
 
hizbe profile image
Muhammad Hizbullah

Hi, if we have the application was installed and configured with laravel-websocket and ready to take off in to production. What configuration we need to set up in our server (VPS)?