title: Laravel (Eloquent) equivalent of Mongoose's populate() method
body: <p>I understand that this question may have more than one DBMS-related answer, but maybe not, so here it goes.</p>
  
  <p>So, I need my app to asynchronously grab some data from the backend, say something like a <code>User</code> and his <code>Posts</code>. I am using Vue2 with Axios on the frontend, so that it would be nice to write something like:</p>
  
  <pre><code>mounted: function() {
      axios.get('/users')
          .then((response) =&gt; {
              this.users = response.data;
          })
          .catch(function (err) {
              // Handle this
          });
  }
  </code></pre>
  
  <p>The outcome I'd like to have is the <code>users</code> object in my VueVM's data to contain also an array of <code>posts</code> for each <code>User</code>. Currently I build a custom associative array in my backend-side controller as follows:</p>
  
  <pre><code>$posts = Post::where('user_id', $id)-&gt;get();
  return json_encode(['user' =&gt; $user, 'posts' =&gt; $posts]);
  </code></pre>
  
  <p>Or, when feasible, I use the <code>has_many</code> method, which is also pretty handy, but I find this solution pretty ugly and lacking reusability.</p>
  
  <p>With Mongoose and MongoDB I would use the <code>populate()</code> method, but I cannot find (that is I actually don't know how to search for it) an equivalent to this with Eloquent.</p>
  
  <p>Any suggestion?</p>