F
Filament15mo ago
MRBUG

is_admin

sorry for asking this type of question again but I want that is in my user's column is_admin to be boolean and if is admin = 1 then I can access the admin panel other this will say in the form you don't have access to login or you are not an admin. I do not want to show them (given image ) how can i archive this type of functionality in filamentphp v3
No description
9 Replies
toeknee
toeknee15mo ago
You can implement a Laravel 403 exception catch to redirect to wherever, pretty sure on access filament, instead of checking just pass in a return if it's false.
MRBUG
MRBUGOP15mo ago
thanks sir but can i change the login panel data like error message "you are not an admin" because then i got 403 after that i am not able to go back and as well as can not go to login page can i rediect to login page with "you are a not admin message " insted of 403
LeandroFerreira
LeandroFerreira15mo ago
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.
MRBUG
MRBUGOP15mo ago
thank you sir i can also show normal user to a new panel ? which will be blank .
LeandroFerreira
LeandroFerreira15mo ago
you can create different panels
MRBUG
MRBUGOP15mo ago
sir how can we redirect them back to login page is he is not a user and show error or message that you are not an admin ?
toeknee
toeknee15mo ago
Just override the login page class and build a validation message in instead.
LeandroFerreira
LeandroFerreira15mo ago
hum, maybe you can customize the login page and edit what you want $panel->login(CustomLogin::class) You can extend the default login class and edit what you need
MRBUG
MRBUGOP15mo ago
thank you so much sir.
Want results from more Discord servers?
Add your server