title: How to join three table by laravel eloquent model
body: <p>I have three table</p>
  
  <h2>Articles table<br></h2>
  
  <pre><code> id
   title
   body
   categories_id
   user_id
  </code></pre>
  
  <h2>Categories table</h2>
  
  <pre><code>  id
    category_name
  </code></pre>
  
  <h2>User table</h2>
  
  <pre><code> id
   user_name
   user_type
  </code></pre>
  
  <p>I want to show articles with their category name instead of category_id and user_name instead of user_id
  I try like these query It is work!</p>
  
  <pre><code>$articles =DB::table('articles')
                  -&gt;join('categories', 'articles.id', '=', 'categories.id')
                  -&gt;join('users', 'users.id', '=', 'articles.user_id')
                  -&gt;select('articles.id','articles.title','articles.body','users.username', 'category.name')
                  -&gt;get();
  </code></pre>
  
  <p>But I want to do by Eloquent way. Please, how could I do?</p>