Level 5
DB::table('usuarios')
->select('usuario_id', DB::raw('count(nombre) as nombre')
->group_by('usuario_ad')
->order_by('nombre', 'desc')
->get();
I didn't test it, but something like that?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How about, I tried to translate this query sql to eloquen, but I do not achieve it, does anyone know how I can do it?
SELECT COUNT(nombre), usuario_ad FROM usuarios GROUP BY usuario_ad ORDER BY COUNT(nombre) desc;
DB::table('usuarios')
->select('usuario_id', DB::raw('count(nombre) as nombre')
->group_by('usuario_ad')
->order_by('nombre', 'desc')
->get();
I didn't test it, but something like that?
Please or to participate in this conversation.