#how to change the guard used in Filament Broadcast Notifications
41 messages · Page 1 of 1 (latest)
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
Are you talking about database-notifications or regular ones?
the regular ones, via websocket
this have nothing to do with the auth/user system, as far as I know
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"
Try changing the model in the laravel auth.php config file.
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
In your BroadcastServiceProvider u can change the middlewares used
Something like Broadcast::routes(['middleware' => ['web','auth:admins']]);
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?
bernhard, i'll take a look into that, is it a more laravel side solution or filament side?
laravel
has nothing to do with filament imho
but its just a guess based on your info 😉
its a pretty good guess actually
thx i'll look into it and will be eternally grateful for the infos
bernhard and Abmael can you please help me with this question?
i'll leave this open until i test it all out ok, and then upon solution i'll post the solution here
BroadcastServiceProvider is not editable anymore on laravel 11
changing the middlewares, just made me end up with no session and no request stuff
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
no solution until now
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
Thank you for marking this question as solved!
Learn more