eloquent-power-joins
eloquent-power-joins copied to clipboard
Conditioning of joins is not consistent
I have these two examples:
$queryBuilder1 = User::query()->joinRelationship('posts.comments', [ 'posts' => function ($join) { $join->where('posts.published', true); }, ]);
and
$queryBuilder2 = User::query()->joinRelationship('posts', [ 'posts' => function ($join) { $join->where('posts.published', true); }, ]);
dump($queryBuilder1->toSql(), $queryBuilder2->toSql());
The only difference is the nesting o relationships... BUT... While the first one (with 'posts.comments') applies correctly where condition - the second one - ignores it completely.
+1
@luisdalmolin any idea?
This should be fixed in 3.0.0. If not, feel free to reopen