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

shez1983's avatar

different user types? how to 'code'?

so if i have diff type of users (client, students, teacher) with some same fields some not - how should i approach this? how would login work? should i do user model and then just have a type? or do i actually have three entities and then do a one-one with user?

0 likes
6 replies
martinbean's avatar
Level 80

@shez1983 Have a single User model, then have a user_type or similar column. Use authorization to determine what a user can see in your application based on their user type.

shez1983's avatar

@martinbean so you are saying i have a policy that dictates what people can do? how do i extend it to say this user cannot see this page...

Please or to participate in this conversation.