How to configure reverb with filament?
i want to be able to chat in admin panel.
i installed laravel broadcasting and reverb
I, following this tutorial https://laraveldaily.com/post/configure-laravel-reverb-filament-broadcasting, did:
php artisan vendor:publish --tag=filament-config
but now i have this:
but i dont use pusher, but reverb
idk how to make it work, i tried:
then i do npm run build
but i always get in console dev tools:
79 Replies
how can i fix it? i cannot find any example on internet
seems like is trying to connect with pusher, online, no?
im using reverb in the server locally, i dont want it to connect to pusher
idk what to put in the cluster, since reverb doesnt have cluster, or it does?
.env:
BROADCAST_DRIVER=reverb
bump
have you figure out how to make reverb work with filament?
This can help you : https://laraveldaily.com/post/configure-laravel-reverb-filament-broadcasting
Laravel Daily
Configure Laravel Reverb in Filament Broadcasting
@ericmp @Rolland please ping me if you have issues with this still. I'm the one that wrote that article 🙂
please read my message, i already sent this link
not yet
i still do ^^
Can you show your .env configuration and
filament.php
section on boardcasting?
(.env is needed around reverb/vite)im in another pc and i didnt commit :v
i can tell u my filament.php looks like this now:
and in the .env i have the keys that reverb sets automatically, i just changed the host to my actual host (subdomain) example.mydomain.com and the port to 443
@ModestasV should i provide more detail?
the subdomain has ssl configured correctly
in the post it says the broadcaster should be pusher, and all the env keys refer to pusher, is that ok or we have to change it to reverb instead?
'broadcaster' => 'pusher',
to
'broadcaster' => 'reverb',
'wsHost' => env('VITE_PUSHER_HOST'),
to
'wsHost' => env('VITE_REVERB_HOST'),
etc
Set
forceTLS
to false
🙂
Here's a sample env
(ignore message that was there before)
what about the cluster? 'cluster' => env('VITE_PUSHER_APP_CLUSTER'), - i can leave it empty? reverb doesnt have cluster, no?
noted. asap ill test it and let u know if i succeeded
okay yeah i have it like this but in the host, my host and port 443 and scheme https
But why? 🙂
why what? what point in specifically?
Reverb port !== https port
no
is the same
cuz then i reverse proxy
Well.. you are complicating your setup 😄
In that case, I can't help much if that's the breaking thing 🙂
oh, so is not needed? i mean, in terms of nginx i dont have to configure anything to make reverb work?
ps. I would first make it work with defaults as much as possible, then see what doesn't work
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.
@ericmp you should follow the official docs for prod deployment 😉
i am doing it: https://laravel.com/docs/11.x/reverb#web-server
no?
let me check
yeah i have it like the docs
But wait, is the reverb not working on prod only?
the reverb works on prod, it doesnt work inside the admin panel
i only have prod, i dont have any other environtments
is a server to test, i code directly there. i only access it
Oh... 🙂
so how u configured reverb. on prod?
id like to know what u did (:
To be fair, followed the official docs 😄
and inside admin panel, just works?
But I made sure that everything works locally first
Yeah, it worked just fine with the panel 🙂
and in ur env u didnt have any pusher key, right?
only reverb keys
what about the cluster key? VITE_PUSHER_APP_CLUSTER
I sent the .env practically as is (from local, but the same with rotated keys in prod) 😄
skip it, there is no clusters
Filament generates the configuration based on what's filled
one thing i dont understand is the error i get:
why it says pusher?
im using reverb, not pusher
where do you get this error?
in a filament admin page
where i try to connect to a defined channel
Can you search your
html
of the site to see what configuration it generated. Specifically search for:
window.Echo = new window.EchoFactory(
u mean in the build echo js public file?
ye
but it shouldn't be in a js file, rather in your main html
Simply visit page, inspect and search for that
ah okay, u mean, go to the admin panel chat page - browser open dev tools and search for that?
yes
but not just chat page, to be fair - any page. As soon as filament loads it should connect
okay, ill test it and ping u, now i can as i said cuz im not at the machine where i can access the server. ill try this and i share u the results
and also try Set forceTLS to false
so far thanks bro, apreciate the feedback
do i need to run "npm install --save-dev laravel-echo pusher-js"? I am on L10.
afaik u dont need to, since if u run
php artisan install:broadcasting
it already does itbut L10 does not have that command. My thought was Filament already have this installed.
then ye i think u r right, but maybe u can update to v11, there is not a lot of breaking changes (https://laravel.com/docs/11.x/upgrade) and u can keep the file strucure of a laravel10 project using laravel11
or u can try to search what php artisan install:broadcasting does exactly on laravel11 and try to do it step by step on your laravel10 project
I see, but for now I wanted to make it working on L10.
anyone recognise this type of error?
share ur .env keys related to reverb
my bad, I just forgot to edit the .env in filament config.
btw in my console i got this:
is it because the tools that I'm using incompatible? Im using Laragon. 😄
Check network tab for
wss
connections and see what error it hasthis?
Okay, can you run reverb with
--debug
flag?
see if it even makes a connectionmy env
if it help, I have ssl enabled.
So that's your problem then
you need the schema to be
https
🙂i set the REVERB_SCHEME=https and restart the reverb. I still got the same problem.
show your
broadcasting
config section 🙂In filament, not this file 🙂 This file does nothing to filament config
filament.php
configuration filemy bad.
Hmm, did you register broadcasting routes correctly? Can you check the list?
list?
php artisan route:list
is it this one?
yep, seems to be okay... hmm
Imma go and cry at the corner of the room and re-trying this tommorow. 😄
Heh... I'm not really able to re-produce this :/
its alright, thank you for trying.
im doing the same xdd, but till today afternoon (,:
did you manage to make it working?
not yet :/
and u?
if i found solution i would share here.
Hey guys. I have exactly the same problem. The console log returns this error:
WebSocket is closed before the connection is established.
, I've been trying to solve it for a few days, but not much success yet. So I am also searching the solution if i found something I will tell.Does anyone have this in a publicly available repo/setting to reproduce?
for me the problem only occurs when using ssl, it worked fine when not using ssl. i am using apache btw
hmm okay. r u doing it in ur machine or in a server?
on my machine
noup :/ (yet ig)
okay
im doing it on a server, and im using https / ssl
i found this discussion. maybe it could help you.
https://github.com/laravel/framework/discussions/50675
GitHub
Laravel Reverb in Production · laravel framework · Discussion #50675
I have created a sample laravel 11 project and in which I have configured all the requirements for the laravel reverb. In local machine/setup reverb is working fine. when I deployed in production s...
appreciate it
the problem though is that i actually can use reverb, im using it with a project in that same server using livewire
but
i cant make it to work inside the admin panel
its been hours again
this is not what is happening
somehow it struggles cuz of the keys of the env or something
i went to a project where reverb worked and tried to change the keys to test
i did it + php artisan optimize:clear. at first, it worked, sending reverb events cool
but then i go back as it was before and doesnt work anymore
i get this error
i tried to google how to generate reverb keys again or refresh them or something but i dont find anything