reduce() 对集合中的元素累计操作
$collection = collect([1,2,3,4]);
return $collection->reduce(function($carry, $item){
return $carry += $item;
}, 0); // 10
$collection = collect([1,2,3,4]);
return $collection->reduce(function($carry, $item){
return $carry += $item;
}, 0); // 10