Several types of accounts, how best to organize at the level of the table/migrations?
I have an app where you will signup different types of accounts.
The three main types are — customer, performer, admin.
The customer can create an account for your Manager. Just show the approximate structure:
1. The customer;
2. The contractor
1. Content Manager
The main three types of accounts, some of them can create other accounts.
Here it is immediately clear that we need parmesani and roles, I will use laravel spatie, accesses can be done by role, parmesana, that's not the problem.
How about the fact that the fields of the table will be different in any different types of accounts (customer, contractor, auditor)? For example, the customer will have fields like name of organization, category of activity, type of company, and so on. And by their fields like price range (how much is an hour of work for example), and all what is not the table of the customer. And so with other roles. At the table level (or entities/logic) how do I best implement this?
Don't make the same different table, like AdminUser, ManagerUser, and so on.
I, in such cases, in the table the user can stand only with regard to authorization. And all the additional fields I stand in a table profile_*. In your case profile_admin, profile_manager , etc.
Jerod_Dicki answered on April 3rd 20 at 18:33
@Kaylee use the "table input" (do not know as it correctly is called)
The point is that you have a separate table which stores the fields and values that are tied to the profile, and you don't need to add a bunch of fields in a specific table with profiles.
profile_setting: profile_id | name | value
well and accordingly build links, and all the problem is solved
deshaun.Nitzsche answered on April 3rd 20 at 18:35