Where is the user-role relationship stored? #2134
Replies: 2 comments 4 replies
-
|
Beta Was this translation helpful? Give feedback.
-
@erikn69 indirectly answered this by pointing you to the migration file showing the table structure.
( «-<» is a text based «crow's foot» ER model notation denoting a 1:N relationship. The parantheses in the second relationship denotes that the relationship is of a type (with attributt model_type concretely in this case) identifying the specific model in question). For user model the model_type is "App\Models\User" and the model_id attribute in model_has_roles seem to be a foreign key to the id in the users table. Is this about correct, @erikn69? What I wonder about is what is the best way to populate the roles for new users. Should I have one blade for user registration and one for role assignment or mix it? (Probably one for each). Should I then create a new model for the model_has_roles table? |
Beta Was this translation helpful? Give feedback.
-
I opened the database and did not find a table with relationships there. Why are they not in the database and where are they stored?
Beta Was this translation helpful? Give feedback.
All reactions