Question and answer is powered by AnsPress.io
How to select records using group by ID in laravel 5 version. I need help
you can follow this code, I think it will be helpful for you.
DB::table('Table_name') ->select('id', DB::raw('count(*) as results')) ->groupBy('id') ->get();