Aug 18, 2018
0
Level 1
Eloquent Relationship Pivot Table with 3 Model
Hi comunity... i'm a little confused, i need to implements a user role according to an trade unions that the user belongs. The user can belongs to a lot of trade unions but his role can be different.
The migrations will be:
users
- id
- name
roles -id -name
tradeunions -id -name
user_rol_trade
- user_id
- role_id
- trade_id
What would be the best way to do it? I've worked with pivot table with two models, but with three, I'm a bit confused Thanks a lot !
Please or to participate in this conversation.