Tables:
teams
teams_users (pivot many teams, many users)
users
What i am trying to achieve$teams->user->where('user_id', $id)->get();
however i am having to run a loop, and create another method on the team model to pluck(id, name) // foreach ($teams as $team) {
// # code...
// dump($team->getUserIdsAttribute());
// }
Do you know a better way?via Harry Bosh