Replies: 1 comment
-
I had a similar issue before (staudenmeir/eloquent-has-many-deep#170), when using \App\Models\User::whereHas('teammates', function (Builder $query) {
$query->where($query->qualifyColumn('id'), 2);
})->get(); I think these 2 issues are related somehow and we should have better column quilifaction on self-related relations. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
This is a really basic examples, but here goes.
Say you have a
company
table, it havecategories
table, andcategories
have self referencing(only two levels tree, it's a example), and you want main categories listThis give me a exception because it is not using alias for through model
Maybe must be like
Beta Was this translation helpful? Give feedback.
All reactions