rob_utopano
3 months ago

Laravel Echo did not receive event (event not broadcasted?)

Posted 3 months ago by rob_utopano

Hey guys,

I´ve followed the instructions on https://github.com/beyondcode/laravel-websockets to setup laravel websockets. Everything works fine so far (websocket server) but I did not receive my event when my controller broadcasts it.

I am using the database queue to listen for my queue and using the ShouldBroadcast Interface to broadcast, but I did not receive the event with my laravel echo client.

This is my code for the echo client:

window.Echo.channel('userpost.{{$post->id}}')
   .listen('.userpost.editModeOn', (e) => {
      console.log(e.id);
   });

The UserPostingEvent is broadcasted using the broadcast() method in my PostController if a user also begins editing the post.

Is there anything I am doing wrong?

Best regards!

Please sign in or create an account to participate in this conversation.