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

kylemabaso's avatar

Multiuser Database Planning

Good day.

I'm an upcoming developer and have a project for a political party. They want to have leads of potential voters, volunteers responsible for recruiting these leads and with some referral benefits to all the leads they capture, employees for other tasks within the system and members who will have a membership number and get access to certain areas of the application. I'm battling with whether all these users should be under one users table or just use the users for login credentials and all the other details separated into members table, employees table volunteers table etc. If I go with separate tables, how does Laravel handle this? I know these might be stupid question, I'll never know if I don't ask right?

I appreciate your advice.

0 likes
3 replies
automica's avatar
automica
Best Answer
Level 54

@kylemabaso i'd go for a single user table to contain authentication details eg username, password, email address etc.

if you also have an optional membership number you should also add that to users.

With respect to certain user credentials, eg membership, then this will lead to you defining middleware based on this field so certain routes can only be accessible if they have a valid membership number.

what you should do next is to define your models and then work out the relationships between the,.

eg

  • User (table = users)
  • Lead (table = leads)
  • Benefit (table = benefits) etc

if you are using separate tables for Employee, Volunteer etc then these will be a hasOne relationship to the user and then you can have a volunteer_id, employee_id field on the User model to map to these tables.

As its early days in your project, the best bet is to build up some models and migrations and then see what it looks like.

You may find using Laravel blueprint is helpful at this point, as that allows all your models, controllers and relationships to be written in a config file that you can quickly use to scaffold your app.

https://github.com/laravel-shift/blueprint

1 like

Please or to participate in this conversation.