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] Fix flat array parameter for relation upsert #52289

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

iamgergo
Copy link
Contributor

This is a followup of #52239.

As is turns it's possible to pass a flat array to the upsert method, not only nested arrays.

This PR makes sure using the upsert method with flat arrays on a relation, works.

I used the ! is_array(reset($values)) check for nested arrays, because the query builder's upsert method does the same.

Also updated the tests.

@taylorotwell taylorotwell merged commit 440ccb0 into laravel:11.x Jul 29, 2024
29 checks passed
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.

None yet

2 participants