Laravel Echo cannot be found on custom page in filament
Hey folks,
First of all echo is working outside filament properly for all type of channel and event are send properly but inside my filament custom page it give those error
which is because it doesnt inject the parameter to echo
Here you can see that every parameters are null.
all my .env are setup properly and the link with vite also (not my production env here)
Anyone have a idea :0 ?
9 Replies
I guess that you have done "npm run build", in case no, you can call that first. And in my custom filament page, i use this to listen the channel event, public function getListeners()
{
return [
"echo:private-channel-name,.EventName" => 'someFunction',
];
} if your channel is private, do use echo:private-channel-name, i tried followed livewire doc using echo-private:channel-name, it did not work for me, and do use the dot before the EventName, in case not working in your event add public function broadcastAs()
{
return 'EventName';
}. hope this helps
. is for whisper if i remember right ?
i give it a try right now thanks for the fast response
the doc said that dot is needed for custom event name if you broadcast a event name different from you event class name, although in my case i used the same name but i also need to add the dot to let it work
i've modified as you said but the issue with the laravele cho not found remains
i notice that your errore said "echo.js?v=3.2.116.0:2 Uncaught You must pass your app key when you instantiate Pusher." do you use pusher? if so, in your .env i see you set REVERB_APP_ID, but you should set PUSHER_APP_ID
ohhh yes sure i use reverb
but i think echo use pusher under the hood
nope, if you want to use pusher, you need to install it
yes sure but i use reverb already outside filament
it works fine
but the instanciation of echo doesnt work on a filament custom page
i think if you have error said something about pusher, so maybe you have used some method or params for pusher instead of reverb