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

notflip's avatar

Seperate Roles in different models or use only User?

I'm making a platform that will have "admins", "patients", and "doctors". I'm using a roles-based package but I'm wondering..

Should they all be "User"? or should I extend each one of the into it's own Model that extends Authenticatable?

Thank you!

0 likes
2 replies
davorminchorov's avatar

They are all users, but they have different roles. No need for extra model classes unless you have extra tables for each role where they have uncommon data and you need to access specific data for each type of user aka user role.

1 like
notflip's avatar

Well a Doctor will have it's own information like address, opening hours, ... A patient will have a medical history, and an admin is just an admin.

How would you go about that? Make a relation with a doctor-data table for example? Doesn't sound like a good plan. Thanks for your time

Please or to participate in this conversation.