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 521834f5da
commit 5d1fe9b815

View File

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