Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

sum of each group in laravel

$sums = $detailed->mapWithKeys(function ($group, $key) {
    return [$key => $group->sum('sales_price')];
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sum #group #laravel
ADD COMMENT
Topic
Name
6+2 =