From 02622dcffc2bdb2233fc1d48e9a5284ca7aaf58d Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Thu, 2 May 2024 23:04:42 -0400 Subject: [PATCH] ternary --- src/Entries/EntryQueryBuilder.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Entries/EntryQueryBuilder.php b/src/Entries/EntryQueryBuilder.php index 0a37b5c3..0eac75dc 100644 --- a/src/Entries/EntryQueryBuilder.php +++ b/src/Entries/EntryQueryBuilder.php @@ -198,11 +198,9 @@ private function ensureCollectionsAreQueriedForStatusQuery(): void $ids = $wheres->where('column', 'id')->flatMap(fn ($where) => $where['values'] ?? [$where['value']]); // If no IDs were queried, fall back to all collections. - if ($ids->isEmpty()) { - return $this->whereIn('collection', Collection::handles()); - } - - $this->whereIn('collection', app(static::class)->whereIn('id', $ids)->pluck('collection')->unique()->values()); + $ids->isEmpty() + ? $this->whereIn('collection', Collection::handles()) + : $this->whereIn('collection', app(static::class)->whereIn('id', $ids)->pluck('collection')->unique()->values()); } private function getCollectionsForStatusQuery(): \Illuminate\Support\Collection