I have 2 tables for users Users and BackendUsers - One for frontend users (regular users / customers) and one for backend users (admin). Take note that these 2 tables have different structures don't tell me to combine them and use ONE table.
I have two solutions in mind:
- Is to duplicate / extend the Authentication to separate the Authentication for backend as seen here: Laravel 5 Implement multiple Auth drivers
- Is to create one more table lets say UserPivot. Wherein there's a column for user_id (integer), and user_type (enum('frontend', 'backend')).
My question is what is the best way to implement this? Do you have better solution?
I want the idea of number 1 since it separates the Authentication for the backend users and it separates the session as well.