Answer the question
In order to leave comments, you need to log in
How to implement owners in laravel?
I need to introduce the concept of an entity owner, into an almost finished project, where roles are also implemented. The owner, for example, of the company entity, has access to editing only one specific company. It is the same with other entities. At the same time, multiple possession of exactly the essences can be different. I think to start by creating a table user_id | entity|entity_id and use the Gate class to set the rules, or at least make your own middleware. Yes, that's just how at the time of the request to catch which entity the user wants to view or edit, and is it really worth keeping some kind of config of the type of correspondence between the route and the entity on this route
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question