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