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.4] Update HasRelations::morphInstanceTo() #18058

Merged
merged 1 commit into from
Feb 22, 2017
Merged

[5.4] Update HasRelations::morphInstanceTo() #18058

merged 1 commit into from
Feb 22, 2017

Conversation

masterwto
Copy link
Contributor

I changed this line so that the static method getActualClassNameForMorph can be overridden.
In my case, the morph relationship is idetified by integers, so I rewrote the static method getActualClassNameForMorph.

I changed this line so that the static method getActualClassNameForMorph can be overridden.
In my case, the morph relationship is idetified by integers, so I rewrote the static method getActualClassNameForMorph.
@taylorotwell taylorotwell merged commit 2f4135d into laravel:5.4 Feb 22, 2017
@GrahamCampbell GrahamCampbell changed the title Update HasRelations::morphInstanceTo() [5.4] Update HasRelations::morphInstanceTo() Feb 23, 2017
@masterwto masterwto deleted the patch-1 branch February 23, 2017 05:02
Yi-pixel added a commit to Yi-pixel/laravel-framework that referenced this pull request Nov 30, 2024
… to be override

This is an addition to laravel#18058 and laravel#18099 from a long time ago.

Use $this->parent to replace Model, which will give users the opportunity to override the default getActualClassNameForMorph behavior in the Model within their own models.

The parent here inherits from the ancestor Relation, and it will be populated when the MorphTo is initialized

Refer to laravel#18058 laravel#18099
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