Skip to content

Commit 75d76d0

Browse files
committed
Use new whereHas
1 parent 50f3233 commit 75d76d0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Http/Controllers/CP/Collections/QueriesAuthorEntries.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ protected function queryAuthorEntries(Builder $query, Collection $collection): v
1717
->whereNotIn('collectionHandle', [$collection->handle()]) // Needed for entries fieldtypes configured for multiple collections
1818
->orWhere(fn ($query) => $query
1919
->whereIn('blueprint', $this->blueprintsWithAuthor($collection->entryBlueprints()))
20-
->whereIn('author', [User::current()->id()])
21-
->orWhereJsonContains('author', User::current()->id())
20+
->whereHas('author', fn ($subquery) => $subquery->where('id', User::current()->id()))
2221
)
2322
->orWhereIn('blueprint', $this->blueprintsWithoutAuthor($collection->entryBlueprints()))
2423
);

0 commit comments

Comments
 (0)