Closed willtj closed 3 days ago
This PR broken morphTo()
usage. If for example we explicitly add qualifyColumn(string $column)
multiple tests will be broken indicating an issue.
This PR has been reverted due as it triggers error on certain MorphTo
relationships. See https://github.com/laravel/framework/pull/53568
In my setup I have some Laravel models stored in MongoDB and others in MySQL. MorphTo and BelongsTo relations aren't loading where the parent model is in MongoDB and the child is in MySQL, i.e:
Child::first()->myRelation
will returnnull
becauseaddConstraints()
is assuming that the key name should be prepended with the table name, which isn't the case for MongoDB.The
getQualifiedOwnerKeyName()
method already exists on the BelongsTo class, is there any reason why it's not currently being used when adding constraints?