I'm about to start a Laravel project and I have doubts about how I should go about it. First of all, I'll have two types of users, the common user, and the admin. I have searched a bit and found out that having two tables is the best solution in my case. Because common users will have all the columns the admins have plus a few more.
I'll create a users_table
and a common_users_table
. The admins will have their data on the users_table
and the common users will have their data spread across both of the tables, with a foreign key on the common_users_table
referencing the users_table
. This way no columns will be unused.
My problem is, I'm not sure how to accomplish that in Laravel. Should I create only 1 model? Maybe 2 models with a hasOne and belongsTo relationship? But when I make the registration forms, how will I register 2 models at once? What about authentication? There are so many things that I simply don't have the experience in Laravel to determine what is better in the long run.
So, if you are more experienced in Laravel and/or have faced a problem like this before, what is the best way to tackle this problem?
Thanks in advance.