8000 Make sure mutators also are called from pivot constructor by phaza · Pull Request #8900 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

Make sure mutators also are called from pivot constructor #8900

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

Closed
wants to merge 2 commits into from
Closed

Make sure mutators also are called from pivot constructor #8900

wants to merge 2 commits into from

Conversation

phaza
Copy link
Contributor
@phaza phaza commented May 27, 2015

This fix makes sure that the Pivot constructor also calls mutators defined on Pivot class by using forceFill instead of setRawAttributes.

@taylorotwell
Copy link
Member

I know this is old but seems broken to me. When we set the new attributes on a new pivot they are fresh out of the database and we shouldn't be mutating them on setting. I think the original code was right and seems to fix problems that have come up because of this:

#12013

Any thoughts?

@phaza
Copy link
Contributor Author
phaza commented Jan 31, 2016

As you said it's a long time ago, but I think my expectation was that a pivot constructor would behave the same way as a model constructor. I don't really remember where/how I was burned by this, so it's hard to argue a use case right now.

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
0