Sunday, March 5, 2017

Group by laravel eloquent

Please, I want to make this query to be eloquent but I don't know how to make it.

I want to use count with Group By and order by count desc

->groupBy('room_id')->get();

but I can not.

Here is my original query:

 SELECT * , count(seeker_id) FROM `jobs_skills` WHERE ( skill_id =2 OR skill_id =3 OR skill_id=5) group by seeker_id ORDER BY count(seeker_id) DESC

I spent a lot of time to solve it but I can't do it.

Please help me.



via John Tadros

Advertisement