I have transactions table :
My table architecture :
id | item_name | quantity | created_at
I have try many method but its not work (link : Laravel Eloquent get results grouped by days.
I want to display it like this :
Example :
Qty : xxx Month : July
Qty : xxx Month : October
Qty : xxx Month : November
How to convert from created_at column to month only grouping and display it as Word instead of numbers and then get count of grouping quantity in that month?
Thank you
$data= Transaction::select('id', 'item_name','quantity', 'created_at')
->get()
->groupBy(function($val) {
return Carbon::parse($val->created_at)->format('m');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With