Closed nickurt closed 3 years ago
I'll look into it.
@nickurt I found sadly that, Laravel removes additional constraints like 'distinct' clause from the relationship query when we use the relation in eager count. Seems like Laravel also removes 'withTrashed' clause.
I released a new version that fixes this issue.
Hey!,
The
loadCount
-function don't work withwithTrashed
because those columns will be not removed from the QueryBuilderwill generate a query like this
while I expected the
bar
.deleted_at
andbaz
.deleted_at
should be deleted just like thewith
function is doing ...Is there a way to solve this?