Nov 26, 2016
0
Level 1
Help with relations through a mapping table
I have 3 tables. Users, Teams, and TeamMemberships. The team memberships table indicates what users are active members of what teams. The users and teams tables are standard tables with "id" keys.
The team_memberships table looks like this: id user_id team_id joined left
What I want is to have a relation on my Team model that will show all the active members of the team.
I've tried belongsToMany and everything else I can think of but I keep hitting a wall.
Any help appreciated. Thanks
Please or to participate in this conversation.