eloquent-power-joins icon indicating copy to clipboard operation
eloquent-power-joins copied to clipboard

Conditioning of joins is not consistent

Open dmikam opened this issue 3 years ago • 1 comments

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.

dmikam avatar Jul 27 '22 09:07 dmikam

+1

beshoo avatar Sep 01 '22 23:09 beshoo

@luisdalmolin any idea?

beshoo avatar Nov 15 '22 21:11 beshoo

This should be fixed in 3.0.0. If not, feel free to reopen

luisdalmolin avatar Mar 05 '23 12:03 luisdalmolin