title: Using count in an eloquent query
body: <pre><code>$data = User::where(function($q){
          $q-&gt;where(User::whereIn('access', array(1,2,3,4))-&gt;count(), 4);
      })-&gt;get();
  </code></pre>
  
  <p>I only want users who have an access of 1,2,3,4 (used this for illustrative purposes but this is usually a passed in array).</p>
  
  <p>I am getting all users where the count of a where in query equals 4.</p>
  
  <p>How can this be done in eloquent? My above code errors, as it is trying to select all from users where 4 = 4.</p>
  
  <p>Where am I going wrong?</p>