i am planning out a school management system, the main actors are ( Teachers ,Students , Parent ).
i though i will simply have
User Model -> will have attributes common to ( Teachers ,Students , Parent ).
Teacher Model -> will have user_id and teacher specific attributes.
Student Model -> will have user_id and student specific attributes
Parent Model -> will have user_id and parent specific attributes
Now i realised that a single user can have multiple roles ,example a Teacher can also be a parent ,this brings up the question of which dashboard to direct them to when they login, how to control / manage their different permissions between the accounts and so forth.
my initial solution was to prompt the any user with multiple roles which account they want to use upon login.
How would you guys tackle this ?????????? whats the best way ...
Do you gonna have some kind of Frontend login for parents and students and a backend for teachers?
Maybe you can use multiple guards and auth instances so you can split the login and tables, i mean, one for users whith user_roles parent / student and another for admins admin_roles (general admin / Teachers)
Top comments (5)
i am planning out a school management system, the main actors are ( Teachers ,Students , Parent ).
i though i will simply have
User Model -> will have attributes common to ( Teachers ,Students , Parent ).
Teacher Model -> will have user_id and teacher specific attributes.
Student Model -> will have user_id and student specific attributes
Parent Model -> will have user_id and parent specific attributes
Now i realised that a single user can have multiple roles ,example a Teacher can also be a parent ,this brings up the question of which dashboard to direct them to when they login, how to control / manage their different permissions between the accounts and so forth.
my initial solution was to prompt the any user with multiple roles which account they want to use upon login.
How would you guys tackle this ?????????? whats the best way ...
Do you gonna have some kind of Frontend login for parents and students and a backend for teachers?
Maybe you can use multiple guards and auth instances so you can split the login and tables, i mean, one for users whith user_roles parent / student and another for admins admin_roles (general admin / Teachers)
thats a nice approach but i was hoping to avoided having extra guard and also avoid polymorphic relationships later on.
thanks for feedback
check this out .
github.com/bitfumes/laravel-multiauth
thanks ..will look into it