title: Get latest values in GROUP BY using Laravel Eloquent ORM
body: <p>I'm trying to understand how Laravel's Eloquent ORM works and was looking at the following MySQL query:</p>
  
  <pre><code>SELECT id, name, date FROM tablename GROUP BY name ORDER BY date
  </code></pre>
  
  <p>The use of <code>GROUP BY</code> always returns the oldest values of <code>name</code>. Is there a way to return the <strong>latest</strong> value instead?</p>