1$user_info = DB::table('usermetas')
2 ->select('browser', DB::raw('count(*) as total'))
3 ->groupBy('browser')
4 ->get();
1$groupedSalesCampaign = Order::with('Campaign')
2 ->where('isapproved','=','Y')
3 ->groupBy('campaign_id')
4 ->orderBy(DB::raw('COUNT(id)','desc'))
5 ->get(array(DB::raw('COUNT(id) as totalsales'),'campaign_id'));