title: Laravel eloquent counting a relation
body: <p>I'm new to laravel and eloquent and I'm not sure if this is even possible. but I have 2 tables with a one to many relationship. One is "locations" and one is "users". One location can have many users.</p>
  
  <p>So if I wanted to get all locations with all users I would just do this:</p>
  
  <pre><code>Location::with("users")-&gt;get();
  </code></pre>
  
  <p>But I also want to know how many users <em>each</em> location has, I tried doing this</p>
  
  <pre><code>Location::with("users")-&gt;count("users")-&gt;get();
  </code></pre>
  
  <p>But that didn't work.</p>