I would like to create a multi-auth app.
I would like to manage everything with two different tables.
Admin table
User table
I would also like to access two different login pages
admin-> login_admin
users-> login_users
The concept is similar to an ecommerce ...
Do you have any advice on how to do it?
I would like to manage everything with two different tables.
@davides98 Why? A user is a user. Why have two tables with pretty much the same information (name, email, password)?
Just use roles, and then authorisation to determine what that user can do based on their role(s). Otherwise what happens when you need to make a third user type, such as warehouse worker? Are you just going to create a third auth guard, third bunch of controllers, views, etc? No. That’s wholly inefficient.
My idea was to separate users and admins for security, then set the roles and permissions in the admins table.
ex.
admins table
-> role 1 = superadmin
-> role 2 =
editor
-> role 3
writer
In practice I configure the file guard to be admin.
But how did you manage the trait of the auth?
Have you managed a controller for the admin and one for the user?
overriding the various functions?