Group by Month and Order the Dates on Laravel Eloquent

 I have the following query $months = \App\DATA::select( DB::raw('sum(order_value) as `sums`'), DB::raw("DATE_FORMAT(created_at,'%M %Y') as months") ) ->where("created_at", ">", \Carbon\Carbon::now()->subMonths(6)) ->groupBy('months') ->get(); that makes a sum of the data for every…

0 Comments