What additional method should i use to get the total price of a product after the groupBy method?? ex. apples -- 20, apples -- 30, apples -- 40, [APPLES totalprice: 90], coconuts -- 10, coconuts -- 20, [COCONUTS totalprice: 30]?? i will wait your answer sir,.. thank you so much for your wonderful video tutorials,.. sorry for my english,..
The BEST as always!
Miss your videos... really sad that you stop( hope you're fine
How can I do this with laravel query builder ?
Is it possible to order the groupBy result according to the number of item they have??
Your tutorials are always super, thanks ! How could I groupby referencing a relationship ? order->products->groupBy(category) ??
What additional method should i use to get the total price of a product after the groupBy method??
ex.
apples -- 20,
apples -- 30,
apples -- 40,
[APPLES totalprice: 90],
coconuts -- 10,
coconuts -- 20,
[COCONUTS totalprice: 30]??
i will wait your answer sir,..
thank you so much for your wonderful video tutorials,..
sorry for my english,..
Can I use ->map()?
Thanks sir,.. i solve my prob in here,..
laracasts.com/discuss/channels/eloquent/summing-a-value-and-grouping-by-date-on-a-eloquent-collection
@@MrAbingPj You can use map or try sum()
You did not mention that we can pass an array and groupBy multiple properties.