1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 16:07:34 +02:00

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,8 +97,9 @@ 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) {
$query
->whereRaw('1=0')
->orWhere(function ($query) use ($actor) {
$this->events->dispatch(
new ScopeModelVisibility(Discussion::query()->setQuery($query), $actor, 'hidePosts')
);