resume chain in query builder

This commit is contained in:
Daniel Klabbers 2019-11-21 11:43:14 +01:00 committed by Daniël Klabbers
parent b35afc2be7
commit 6fcc720f6c

View File

@ -99,12 +99,13 @@ class PostPolicy extends AbstractPolicy
->from('discussions')
->whereColumn('discussions.id', 'posts.discussion_id')
->where(function ($query) use ($actor) {
$query->whereRaw('1=0');
$query->orWhere(function ($query) use ($actor) {
$this->events->dispatch(
new ScopeModelVisibility(Discussion::query()->setQuery($query), $actor, 'hidePosts')
);
});
$query
->whereRaw('1=0')
->orWhere(function ($query) use ($actor) {
$this->events->dispatch(
new ScopeModelVisibility(Discussion::query()->setQuery($query), $actor, 'hidePosts')
);
});
});
});
});