title: How To use Eloquent in From One Model to another model through intermediate table
body: <p>i have three models  </p>
  
  <p><strong>Article</strong>  </p>
  
  <pre><code>id 
  title 
  </code></pre>
  
  <p><strong>Comment</strong></p>
  
  <pre><code>id
  title
  user_id
  article_id
  </code></pre>
  
  <p><strong>User</strong> </p>
  
  <pre><code>id 
  name
  </code></pre>
  
  <p>what i wanna achieve  is to select one article based on its id with comments and user info that made that comment </p>
  
  <p>like that : </p>
  
  <pre><code>$article = Article::find($id -- say 1)-&gt;with('comments' -- this is a relation in Article Model)-&gt;get(); 
  </code></pre>
  
  <p>this gives me article with related comments as an array of objects say comment one - comment two etc .... </p>
  
  <p>what i want instead of user_id in comment object i wanna it to be a user object </p>
  
  <p>see this pic thats what i reached so far  </p>
  
  <p><a href="https://i.stack.imgur.com/rA9X9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rA9X9.png" alt="screen of what i have done "></a></p>
  
  <p>using laravel 5.4 </p>