Laravel group record by months and sum price
<p>Hello i am trying to group record by months and sum price from orders</p>

<p>I tried something like this</p>

<pre><code>       $order = Order::select(DB::raw('sum(price) as sums'))-&gt;groupBy(function($date) {
    return Carbon::parse($date-&gt;created_at)-&gt;format('Y-m');

});
</code></pre>

<p>but no luck, 
I wanna get collection which I could later implement in data-tables?</p>