title: Get Model where relationship = id
body: <p>Would love to know how other people are achieving the following?</p>
  
  <p>Tables:</p>
  
  <pre><code>teams 
  teams_users (pivot many teams, many users)
  users
  </code></pre>
  
  <p>What i am trying to achieve</p>
  
  <pre><code>$teams-&gt;user-&gt;where('user_id', $id)-&gt;get();
  </code></pre>
  
  <p>however i am having to run a loop, and create another method on the team model to pluck(id, name)</p>
  
  <pre><code>// foreach ($teams as $team) {
  //     # code...
  //     dump($team-&gt;getUserIdsAttribute());
  // }
  </code></pre>
  
  <p>Do you know a better way?</p>