Laravel Reverb not Broadcasting REST API with Docker #51864
Replies: 2 comments 2 replies
-
Echo prefixes the event name with "App.Events." so in examples you don't see For: App\Events\Orders\OrderCanceled it will become => The rest of your setup based on what you said seems fine, if this is not the problem a public repo that you can share with us that reproduces this bug will be helpful. |
Beta Was this translation helpful? Give feedback.
-
Fixed! There were a few issues in the end. Backend REST api:
This wasn't clear and the default options in the comments
Code:
Front end
Code:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My Laravel 11 application is not broadcasting anything using Laravel Reverb. I am using a custom Docker configuration to spin up my enviornment and Laravel acts as a REST api interacting with a React stand-alone front-end.
My
reverb.php
file in myconfig/
directory is untouched as I just updated the.env
.The
broadcasting.php
file has this set as the driver as from what I gather Laravel Reverb runs it's own configreverb.php
.When running
php artisan queue:listen
within my Docker container I can see the Events firing and everything running as it should...When running within my Docker container
php artisan reverb:start --debug
I can see some ping logs.With the front-end in the Network tab again everything looks ok, it pings the
/broadcasting/auth
and my setupws://localhost:9090/app/
The connection itself seems ok? One thing to note is if I hit the endpoint to fire the event, I see no logs for the broacast
php artisan reverb:start --debug
My Event, which is really basic for now and gets caught and logs when runnig
queue:listen
but never broadcasts, although the thebroadcastOn()
method gets hit and I can catch with add()
Even if I make a channel not private I still get nothing!
in my
channels.php
thedd()
inside thechannel_for_everyone
never hits, but the file is 100% getting loaded as when I dd() above it willdd('it will hit here!);
My React code is super basic, I made a hook to execute and it logs a successful connection, just no events are every logged.
When I check the console in browser:
I know this must be some kind of configuration error but I just cannot seem to find the issue as I have no errors or logs to go off!
Has anyone got any idea?
Beta Was this translation helpful? Give feedback.
All reactions