Published 6 months ago by mdeorue
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.
Hi, thanks for the reply, I actually do this, but the player_position is a related table to team_positions.
The team_positions table has... id | description
So I want to take this...
So for any team, I can take all the players and the position description in the team.