Reputation: 53
I'm new to Laravel 5.1 and I'm currently working on a project to familiarize with Laravel on my own.
I have many tables in my application but I'm getting stuck on a specific multiple relation between 3 tables (that maybe should use Pivot tables).
So, I have 3 tables :
The following rules apply to the relationships :
(permissions are linked to roles and allow a user with a specific role to perform a defined set of actions on a project)
I initially had a Users <-> Roles which worked well (as far as code is concerned) but the role defined for a user permitted to do a predefined set of things on every project (which is not flexible enough to me).
I already saw another post with approx. the same title as mine but I'm afraid this can't address my needs because the properties are held on the intersection table though in my case, I already have the physical tables.
Upvotes: 4
Views: 239
Reputation: 28541
Make a model for your pivot table, this should make it easier to work with.
ProjectAssignee:
Then you can define following relationships:
Upvotes: 1