Skip to content

Conversation

alipowerful7
Copy link
Contributor

@alipowerful7 alipowerful7 commented Oct 10, 2025

This PR introduces a new static method Arr::sum() to the Arr class.
It provides an easy way to calculate the sum of array values — including nested arrays —
and supports summing by a specific key or a custom callable (similar to Collection::sum()).

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!

@alipowerful7 alipowerful7 deleted the feature/add-sum-method-in-Arr branch October 10, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants