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

[8.x] BelongsToMany->sync() will support touching for pivots when the result contains detached items #38085

Merged

Conversation

christoph-kluge
Copy link
Contributor

@christoph-kluge christoph-kluge commented Jul 20, 2021

Relates to #38084.

While running the following code $news was not touched. This PR will add support when $touching is correctly defined on the pivot.

$news->authors()->saveMany([
    new User(['id' => 1]),
    new User(['id' => 2]),
    new User(['id' => 3])
])
$news->authors->sync([1,2]);

@christoph-kluge christoph-kluge changed the title BelongsToMany->sync() will support touching for pivots when the result contains detached items [8.x] BelongsToMany->sync() will support touching for pivots when the result contains detached items Jul 20, 2021
@christoph-kluge christoph-kluge marked this pull request as ready for review July 20, 2021 22:21
@taylorotwell taylorotwell merged commit a17fd16 into laravel:8.x Jul 21, 2021
@christoph-kluge christoph-kluge deleted the respect-touching-when-detached branch July 21, 2021 12:42
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