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
After updating to v11.42.0, which implements these changes, a query like
return $query->withWhereHas('model:column', function ($query) {
// something ;
});
throws a RelationNotFoundException "Call to undefined relationship [model:column] on model [App\Models{model}]
But if I remove the ":column" in withWhereHas, I don't get any exception.
I'm not sure if now this a correct behaviour, so I'm writing this comment before creating an issue.
After updating to v11.42.0, which implements these changes, a query like
return $query->withWhereHas('model:column', function ($query) {
// something ;
});
throws a RelationNotFoundException "Call to undefined relationship [model:column] on model [App\Models{model}] But if I remove the ":column" in withWhere has, I don't get any exception.
I'm not sure if now this a correct behaviour, so I'm writing this comment before creating an issue.
I'll look into this today for you. It may be worth creating an issue anyway, but link to this PR and tag me in it. I'll see if I can figure out what's happening.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR merges in any eager loads from nested where clauses, so that
withWhereHascan be used within a nestedwhere.