#how to change the guard used in Filament Broadcast Notifications

41 messages · Page 1 of 1 (latest)

tiny treeBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

chrome epoch
#

i've managed to login, and also the php artisan make:filament-user is working with the Admin:class, also i can login on the admin panel

#

the only thing that's not working with the new guard is the notifications via websocket

mellow igloo
#

Are you talking about database-notifications or regular ones?

chrome epoch
#

the regular ones, via websocket

mellow igloo
#

this have nothing to do with the auth/user system, as far as I know

chrome epoch
#

i've commented IN filament.php's laravel echo config and it worked with user:class, but not admin:class

#

i'm really frustrated, the Notification::make()->broadcast(User:all()), if i change the guard to the user class, it works

#

if i use the Admin:all() and change the guard to the Admin class, it doesn't work

#

also tried different channels with no success

#

commented in*

#

it uses the laravel broadcast route /broadcast/auth to verify which user is logged in on which model

#

i couldn't find a way to change this /broadcast/auth route guard, which specifies the model used in the auth

#

everywhere says that the BroadcastServiceProvider file can be edited, but that's not even "publishable"

warm plank
#

Try changing the model in the laravel auth.php config file.

chrome epoch
#

actually i need the web guard to be User:class, and the admin guard which is a custom one that i made for Admin:class, to work separately

#

i really have no time in the project to add permissions and stuff alike

#

but on filament side, i've managed to use for like everything the admin:class, for log in, even the artisan commands are using it for creation of new users

#

the problem is specific on the websocket broadcasting

#

doesn't notify Admin:class, only User:class

#

which was the former model used

mellow igloo
#

In your BroadcastServiceProvider u can change the middlewares used

#

Something like Broadcast::routes(['middleware' => ['web','auth:admins']]);

sly galleon
#

I have a posted a question but at the moment no one is answering is there anyone who can help me with Export functionality and Notifications?

chrome epoch
#

bernhard, i'll take a look into that, is it a more laravel side solution or filament side?

mellow igloo
#

laravel

#

has nothing to do with filament imho

#

but its just a guess based on your info 😉

chrome epoch
#

its a pretty good guess actually

#

thx i'll look into it and will be eternally grateful for the infos

sly galleon
chrome epoch
#

i'll leave this open until i test it all out ok, and then upon solution i'll post the solution here

jaunty storm
#

BroadcastServiceProvider is not editable anymore on laravel 11

jaunty storm
#

changing the middlewares, just made me end up with no session and no request stuff

chrome epoch
#

the session and request are all missing, empty arrays

#

no solution until now

#

i've tried making a middleware to check if the user is from User:class or Admin:class, but the middleware have no data whatsoever on logs, empty arrays and that's that

jaunty storm
#

no solution until now

chrome epoch
#

i've changed the guard to user back, and none are working

#

so FSR nothing works, maybe its not filament related, i'm closing this thread

tiny treeBOT