Filament-User vs. Frontend-User
Hi everyone! I'm newish to Filament and Laravel so I'm not sure what the best solution to this is:
I want to build a tool consisting of a backend UI (Filament) with several panels and user roles. I also want a frontend with a super basic login functionality, as you see it on every site. What's the best way to handle these both user data? Should I have two different DB user tables? I installed Laravel Breeze and noticed that it interacts directly with the Filament users and sessions. What is the best approach here?
4 Replies
What exactly is the end goal?
So filament is primarily an admin management system.If a user from a FE is typically logging in and having their own dashboard etc, that would typically also be custom views etc.
Can use the same User model/db, just how data is handled would be different involving permissions
Imagine a basic site with FE login, like Twitter. Logging into the FE loads your stuff, your posts, etc. Additionally I need an administration system like Filament for the admins. The admins can see all posts, manage FE users, etc. But of course the FE login should not be an access to the admin panel.
I figured that using the same User model/db would be doable, and that I'd need to define permissions then. But I'm not sure what the best practice is in terms of clean code and user maintenance, if mixing both user data in one table is the way to go
It's easier to keep them in one table - and for production you will need to enable which users have access to filament https://filamentphp.com/docs/3.x/panels/users#authorizing-access-to-the-panel - depending on your granularity you could just add an
is_admin
flag to the user table and check thatGotcha, sounds reasonable. Will give it a try, thank you guys!