[Vuejs]-Laravel Echo + Redis + Socket.io

0👍

I think there few things that you’ve miss.

If your setup like this Redis + Laravel Echo Server + Socket.io, then you can try this.

  1. Update BROADCAST_DRIVER, QUEUE_DRIVER, QUEUE_CONNECTION on .env file to redis. Run redis-server, and artisan queue:listen --tries=1 and also laravel-echo-server start
  2. On your Event class, there’s no data you want to sent/broadcast. Try add broadcastWith method and simply return whatever data you want inside that method. You can read on Laravel official documentation https://laravel.com/docs/5.6/broadcasting#broadcast-data

0👍

One thing is to remove the ‘.’ from the beginning of the event name ‘MessageSent’:

Echo.channel('chat-channel').listen('MessageSent', (message) => ...

Also you can check out this reply

Leave a comment