Routing issues
Hey all, I'm kind of new to using filament, and I would appreciate some help if possible. I am trying to build a dashboard panel for an admin but i want to use my own route not the preset one from filament.
7 Replies
Here is the route I want to use
Since i am currently using a user table and differentiating admins from a normal user i am using the user_type column
Here is the UserController that handles this
What are you exactly trying to do/solve? It sounds like you just want to have two different panels, one for admins and one for users, no?
Well I want to build the admin panel using filament. When I created the filament panel in my cmd it gave me a default route of admin. I want to change the route so whenever users with user_type = admin follow the admin.dashboard route.
I dont have any issues with the controller. I just want to change the path in the filament panel file. I don't know if you get the point
i changed it in the provided file but it didn't work
I just think that you're manually trying to solve something that you can solve with Filament natively
Any tips on how to do taht
that*
You can create two panels, and have them both have a separate path. One for users, one for admins
https://filamentphp.com/docs/3.x/panels/configuration#the-default-admin-panel
Then you can do the authorization (user_type = admin can only access the admin panel, etc) via the Users model: https://filamentphp.com/docs/3.x/panels/users#authorizing-access-to-the-panel
Alright. Thanks I appreciate it.
I still seem to have some issues. Maybe I didn't make my point clear. So when i create a panel, it has a default path whether it be admin or whatever. In my routes i have a route which returns the admin/dashboard/{id} where id is the id of the user. What i want to do is take this route and return the view in my adminpanel provided by filament.
The usercontrollers function does not redirect me to the view contained within the adminpanel but instead to a blank blade file. Hopefully I made myself clearer this time