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

[5.2] Use relation setter when setting relations #13001

Merged
merged 1 commit into from
Apr 3, 2016
Merged

[5.2] Use relation setter when setting relations #13001

merged 1 commit into from
Apr 3, 2016

Conversation

IsraelOrtuno
Copy link
Contributor

I am currently working in a project which really need to have access to the moment when an Eloquent relation is loaded. Currently, Eloquent uses setRelation only when using eager loading. If a relationship is just lazy loaded by its property name, Eloquent just sets $this->relations[$method] manually (from getRelationshipFromMethod).

In order to make Eloquent easier to extend and overwrite, I suggest to use the Eloquent relation setter also in this case.

@GrahamCampbell GrahamCampbell changed the title Use relation setter when setting relations [5.2] Use relation setter when setting relations Apr 3, 2016
@taylorotwell taylorotwell merged commit 341fe49 into laravel:5.2 Apr 3, 2016
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

3 participants