You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?
Laravel Version
11.33.0
PHP Version
8.3.13
Database Driver & Version
No response
Description
Since version 11.33.0 and more precisely this commit: 8528d04, the constraints applied on
MorphTo
relations have changed.For the example, let's say I have the example relation from the docs: https://laravel.com/docs/11.x/eloquent-relationships#one-to-one-polymorphic-model-structure. So I have an
Image
model with animageable
relation (MorphTo
), pointing to aPost
.Before that commit, the foreign key constraint was correctly added to the relation query: it added a where like this:
Now with the latest version, the only where is:
This bug breaks some packages like https://github.com/kirschbaum-development/eloquent-power-joins.
Steps To Reproduce
MorphTo
relation (for exampleImage::imageable
)$relation = (new Image)->imageable()
wheres
of the query11.32.x
to11.33.x
Feel free to ask if you need a proper reproduction to work on this but I think you have some test projects already covering this feature.
Thanks for your help!
The text was updated successfully, but these errors were encountered: