title: Laravel Collection group by with max value
body: <p>I have what is hopefully a quick question regarding Laravel's collections. What is the best way to group by a certain id and only take entries meeting a certain criteria? Using the meetings table example below, I am trying to take the most recent meeting for each company_id. In other words, I would like to reduce the array below to only ids: 2, 5, and 8.</p>
  
  <pre><code>id | company_id | date       | topic  | attendees
  1  | 1          | 2015-06-30 | Intro  | 5
  2  | 1          | 2015-09-30 | Update | 2
  3  | 1          | 2013-03-30 | Update | 4
  4  | 2          | 2014-03-30 | Intro  | 3
  5  | 2          | 2015-01-15 | Update | 8
  6  | 3          | 2012-10-15 | Intro  | 12
  7  | 3          | 2015-06-15 | Update | 5
  8  | 3          | 2015-09-15 | Update | 2
  </code></pre>