how to get latest record from the database having same id in laravel?
<p>I am trying to to get latest record having the same id. For example
I have table</p>

<pre><code> ID | Created_at
  1 |2016-04-26
  1 |2016-04-20
  1 |2016-04-18
  2 |2016-04-27
  2 |2016-04-19
</code></pre>

<p>I want to get result like this</p>

<pre><code>ID  | Created_at
1   |2016-04-26
2   |2016-04-27
</code></pre>

<p>How do I do this in Laravel? I was only able to order the record by descending order. Don't know how to pick the latest record of each ID. Thank you.</p>