From 6fcc720f6c58e0ab5510eca0a33301b4785ebf9e Mon Sep 17 00:00:00 2001 From: Daniel Klabbers Date: Thu, 21 Nov 2019 11:43:14 +0100 Subject: [PATCH] resume chain in query builder --- framework/core/src/Post/PostPolicy.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/framework/core/src/Post/PostPolicy.php b/framework/core/src/Post/PostPolicy.php index 358c5a899..96fe481b6 100644 --- a/framework/core/src/Post/PostPolicy.php +++ b/framework/core/src/Post/PostPolicy.php @@ -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') + ); + }); }); }); });