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

[9.x] Allow for nullable morphs in whereNotMorphedTo #42878

Merged
merged 1 commit into from
Jun 20, 2022
Merged

[9.x] Allow for nullable morphs in whereNotMorphedTo #42878

merged 1 commit into from
Jun 20, 2022

Conversation

patrickomeara
Copy link
Contributor

This PR uses the null safe operator <=> instead of = to return results with a null polymorphic relationship as well as those not related with a polymorphic relationship. When this method was first introduced in #42264 (by me) null polymorphic relationships were ignored by whereNotMorphedTo and orWhereNotMorphedTo. This was on oversight on my behalf.

Thanks to @yngc0der for pointing this out.

For anyone using whereNotMorphedTo with nullable polymorphic relationships, you were getting incorrect results, here is the fix.

* use the null safe operator to return null polymorphic relationships
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