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

varovas's avatar

User account with child users.

Hi, what's the best practice to make user accounts that can have child users? Ex. A user registers to a services management app. And he can create accounts for his other employees. Employees can login to a services management app and can manage services created by parent user. What's the best practice to handle that kind of functionality?

0 likes
3 replies
bobbybouwmann's avatar

I would probably create two entities here. Something like a Company and a User. So a user can invite other users, but a user is always connected to the same "Company". So when you login you always see the same data, since everything is connected to that company.

You then create different roles for what a user can do. This role can also be based on who created the company or whatever.

If you need more help let me know ;)

oluwajubelo's avatar

@bobbybouwmann , please i have an admin backend which i want only the super admin to be able to delete any other users, i don't want users to be able to delete another user. Please, i you help me out?

Please or to participate in this conversation.