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');
So guys, i have got the answer for this, Thank you for reading my question.
$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) day')))
->groupBy('day')
->orderBy('w.created_at')
->get();
The Raw query in my query was wrong for the created_at field. Now its good. Hope you will also get some input from this.