Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Arr helper map spread #50474

Merged
merged 6 commits into from
Mar 12, 2024
Merged

[11.x] Arr helper map spread #50474

merged 6 commits into from
Mar 12, 2024

Conversation

bilfeldt
Copy link
Contributor

This PR simply adds an already well-known Collection function $collection->mapSpread() to the Array helper:

Arr::mapSpread($data, fn ($first, $second) => $first.$second)

The underlaying logic is completely the same as the already provided Collection function, the point of this PR is to allow for this often used array manipulation without the overhead of creating a Collection instance first.

@driesvints driesvints changed the title Arr helper map spread [11.x] Arr helper map spread Mar 12, 2024
@taylorotwell taylorotwell merged commit 2cc827a into laravel:11.x Mar 12, 2024
53 checks passed
@bilfeldt bilfeldt deleted the arr-helper-map-spread branch March 12, 2024 19:50
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