$chapter= array();
$chapter = DB::table('Table_Name')->select( DB::raw('format(number,0) as chapter'), DB::raw('count(*) as total'))->groupBy(\DB::raw('format(number,0)'))->get();
decimal to integer group by query in laravel
in Laravel