Realtion in Pivot Table

Posted 1 year ago by mdeorue

Hi guys,

I need your help, first sorry for my english, is too bad.

Well, I have 2 tables, teams and players, so I got a Many to Many relation, player_team, but in a team some players have different positions, like captain, etc... I made a column in player_team pivot table, that indicates the player position, captain, trainer, etc... And this column has a relation with player_positions.

I need that when I use belongsToMany relation I got the player_position relation eager load. So when I want the players of a team, I got there position too.

Thank you a lot for your help.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.