title: Laravel Eloquent retrieve data from multiple tables
body: <p>I have four tables</p>
  
  <pre><code>**Articles table**
  
   id
   title
   body
   owner_id
   category_id
  
  **Favorite articles table**
  
    id
    user_id
    article_id
  
  **User table**
  
   id
   user_name
   user_type
  
  **Category table**
  
   id
   category_name
  </code></pre>
  
  <p>How to get list of favorite articles (article_name,owner_name,category_name) which related to currently logged user  from db using laravel eloquent?</p>
  
  <p>Is it possible to do it in single line request? e.g.:</p>
  
  <pre><code>$articles_data=Auth::user()-&gt;favorite_articles-&gt;article...
  </code></pre>
  
  <p><strong>EDIT</strong>
  For the moment i have to use statement below:</p>
  
  <pre><code>$articles_data = FavoriteArticle::where('user_id', Auth::id())-&gt;join('articles', 'articles.id', '=', 'favorite_articles.article.id')
                              -&gt;join('users', 'users.id', '=', 'favorite_articles.user_id')
                              -&gt;join('categories', 'categories.id', '=', 'articles.id')
                              -&gt;get()
  </code></pre>
  
  <p>Which looks a bit complicated and doesn't use eloquent relations.</p>