4
I have a table with the following fields:
id, texto, autor_id, data
I need the records to be grouped by autor_id
(because it has several texts with the same author) and return me in ascending order the newest only. I’m using Lavarel and my Eloquent code is as follows::
Discursos::take(10)->distinct('membro_id')->orderBy('data_discurso', 'asc')->get();
Place groupBy
in place of distinct
is returning me only the oldest of the records. How to do otherwise?
What I am doing is returning a text list in which the author has not registered for a long time, I want you to return to me to know which author has not registered anything for a long time.
To explain to you... I have a table with the record of speeches, what I need is a control in which will list me the discusantes that the longest time has no speech recorded, so I can warn you that it has been a long time that he does not register a speech. Thank you
– tvieira