I am trying to make an elqouent query for a following sql,
select sum(w.total_item_count) as Day_count, w.created_at as created_at from `sales_flat_orders`
$orderbydate = DB::table('sales_flat_orders as w') ->select(array(DB::Raw('sum(w.total_item_count) as Day_count'),DB::Raw('DATE(w.created_at) as created_at'))) ->orderBy('w.created_at') ->get(); $orderbydate->groupBy('w.created_at');