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

[6.x] Fix refresh() to support AsPivot trait #32420

Merged
merged 2 commits into from
Apr 17, 2020
Merged

[6.x] Fix refresh() to support AsPivot trait #32420

merged 2 commits into from
Apr 17, 2020

Conversation

LastDragon-ru
Copy link
Contributor

@LastDragon-ru LastDragon-ru commented Apr 17, 2020

The regression was introduced in #31125 - all custom pivot models that uses AsPivot trait are broken now due to this line:

return $relation instanceof Pivot;

In other words $model->refresh() will throw error "Call to undefined relationship [pivot] on model" if $model has relations that uses AsPivot trait instead extending Pivot model.

This PR fixes it and closes #31811 (please also see it for more details).

@LastDragon-ru LastDragon-ru changed the title The refresh() fix to support AsPivot trait. [6.x] The refresh() fix to support AsPivot trait. Apr 17, 2020
@driesvints
Copy link
Member

@LastDragon-ru it's best to describe in the PR why this is needed (see the PR template).

@GrahamCampbell GrahamCampbell changed the title [6.x] The refresh() fix to support AsPivot trait. [6.x] Fix refresh() to support AsPivot trait Apr 17, 2020
@LastDragon-ru
Copy link
Contributor Author

@driesvints, done

@taylorotwell taylorotwell merged commit bb04588 into laravel:6.x Apr 17, 2020
@driesvints
Copy link
Member

@LastDragon-ru thanks!

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.

3 participants