title: Laravel Group By Date
body: <p>I am trying to make an elqouent query for a following sql, </p>
  
  <pre><code>select sum(w.total_item_count) as Day_count, w.created_at as created_at from `sales_flat_orders` as `w` group by DATE(`w`.`created_at`) order by `w`.`created_at` asc
  </code></pre>
  
  <p>and I have tried this</p>
  
  <pre><code>$orderbydate = DB::table('sales_flat_orders as w')
                  -&gt;select(array(DB::Raw('sum(w.total_item_count) as Day_count'),DB::Raw('DATE(w.created_at) as created_at')))
                  -&gt;groupBy('w.created_at')
                  -&gt;orderBy('w.created_at')
                  -&gt;get();
  </code></pre>
  
  <p>I am getting correct output in sql query but not in eloquent query,
  Please help, Thanks.</p>