Closed 7Jhanson closed 2 years ago
I have something like:
QueryBuilder::for(Object::class) ->whereHas('comments')->orWhereHas('relation.comments')->orWhereHas('relation.relationChild.comments') ->allowedFilters($this->setAllowedFilter($this->filters)) ->allowedSorts($this->setAllowedSorts($this->filters)) ->paginate(data_get($options, 'pagination.rowsPerPage'), ['*'], 'page', data_get($options, 'pagination.page'));
when adding the ->orWhereHas('relation.comments')->orWhereHas('relation.relationChild.comments')
->orWhereHas('relation.comments')->orWhereHas('relation.relationChild.comments')
the filters don't work anymore, because the package uses whereHas.
Any solutions to make it so I can use orWhereHas and filter at the same time?
orWhereHas
I have something like:
QueryBuilder::for(Object::class) ->whereHas('comments')->orWhereHas('relation.comments')->orWhereHas('relation.relationChild.comments') ->allowedFilters($this->setAllowedFilter($this->filters)) ->allowedSorts($this->setAllowedSorts($this->filters)) ->paginate(data_get($options, 'pagination.rowsPerPage'), ['*'], 'page', data_get($options, 'pagination.page'));
when adding the
->orWhereHas('relation.comments')->orWhereHas('relation.relationChild.comments')
the filters don't work anymore, because the package uses whereHas.
Any solutions to make it so I can use
orWhereHas
and filter at the same time?