Databse notifications with echo, websocket doesnt receive messages
I set up the database notifications with pusher, the event sends a message successfully to pusher, only the front-end doesnt seem to be receiving these messages, could it be that im missing something?
42 Replies
Do they ever receive them, so on page refresh?
I dont think so, so far I only get the connection message
In pusher I do get the message sent by the event
I'm not familiar with pusher, are you using filamentNotifications? if so have you setup the notifications icon and livewire call
Yes I have, I do get the notifications but only with the polling functionality
Ok so they are storing correctly, I am a little unsure how you would handle the websocket behaviour to be honest, one of the other guys may have a better solution
Alright, thanks for trying 😄
No problem
did you dispatch the event?
cant remember what its called
Yeah its dispatching it correctly
did you set up a private broadcasting channel?
in channels.php
Hmm, that I have not !
It does have this one already set up in the project:
That should be correct right? seeing that in pusher it uses channel private-App.Models.User.3
lets simplify
add to User.php
in channels.php
Again the same, it sends it sucessfully to pusher, with the new channel, only the f/e doesnt receive the message
strange
can you debug in the pusher dashboard?
you could send a screenshot of that
this is what I can see in pusher
so theres a connection but the channel is not subscribed?
because there should be a Subscription event there
can you show me how you've set up Laravel Echo in your JS?
Yeah seems like its not subscribing but it is connecting
can you see
window.addEventListener('EchoLoaded', () => {
anywhere in your generated HTML?found this in the source
(im logged in as user 2 rn, instead of user 3 when I sent the pusher screenshot)
maybe that isnt being executed?
can you try sending that window.dispatchEvent line from the JS console
hmm
do you have the pusher php sdk installed
Yeah thats installed!
why isnt that route set up? 🤔
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Added them, they give a 403 though
is your Broadcast::channel callback being hit?
it's very likely that either that is returning false, or Pusher is not properly installed in PHP. I also hit that before
yeah nothing is happening in here
okay well you can debug inside the laravel core
as to why this isnt being executed
please double check pusher is set up correctly in php
I will check, do you have any resources / tips on how to? 😊
not really
track the code execution path i guess
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Hi yes I had it enabled! thanks
well, it does work on production, so I guess ill leave it like this 😆
weird lol