Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mac03733's avatar

Multiple User Types

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 ...

0 likes
5 replies
Snapey's avatar

Don't call people out please. If we are here we will try and help. It can also discourage those not mentioned from answering.

In this case I would put all attributes in the user model or a single profile and then use authorization (roles) to determine what they can do

mac03733's avatar

@SNAPEY - just thought i was drawing some attention to the question ... but ya i get you ..can be discouraging ,ddnt think it through.. sorry

wont putting all the attributes in one model be wasteful and result in unnormalised tables concidering that teachers,student, parents may have different attributes

Snapey's avatar

If you have millions of users it might be a concern.

Please or to participate in this conversation.