title: How can I interrogate user activity in Laravel
body: <p>I'm looking for a way to best analyse the user data in our app.</p>
  <p>for example</p>
  <ul>
  <li>how many users have read 0 articles on our site</li>
  <li>how many users have read 1 article on our site etc</li>
  </ul>
  <p>we have a <code>users</code> table with <code>id</code>, <code>username</code> columns and we also have an <code>activities</code> table that creates an entry when an article is viewed. For example it would create a database row with</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>activity</th>
  <th>user_id</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>read</td>
  <td>1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>all of the data we need is there, I just don't know how to interrogate to give that detail.</p>