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

mac03733's avatar

Admin ,Users ---> separate table VS single table

hi guys. i am new to laravel and i know this is probably a matter of preference.

but i am curious which approach is the best

0 likes
8 replies
tykus's avatar

Single table for me unless there is a compelling reason not to.

Cronix's avatar

users, roles. Or users, with is_admin flag. A user is a user.

joshuaify's avatar

@Cronix How amount is a SAAS (Software as a service) system? What are your thoughts on having an admin table for the system managers while users table for tenants (Different organizations subscribers admin users) and other users?

JussiMannisto's avatar

@joshuaify My strong opinion is that you shouldn't do it. It can complicate things massively later on. Use roles for authorization instead.

1 like
procell's avatar

Also users, roles. Even if there's a single role, it's easier to extend in the future with separate tables, I find.

mac03733's avatar

are there any major drawback i should worry bout with any of them .. and which questions or likely situations would require one or the other approach

florianhusquinet's avatar

If you decide to build an extra table for the admins you then have to extend the default auth system which is a lot of extra work considering you could simply have a role and do $user->hasRole('admin') when needed.

Another option if you do not want to use roles nor a flag and need extra columns for your admins is to use a one to one relationship. Your admins table can have the user_id as well as the columns you need without messing with Laravel's auth system.

2 likes

Please or to participate in this conversation.