From 8e30037b13cfc6bab17b7913d269af3703d744ae Mon Sep 17 00:00:00 2001 From: edlib-oddarne Date: Fri, 13 Mar 2026 14:57:19 +0100 Subject: [PATCH] Generate a list of hitids from array --- sourcecode/hub/app/Http/Requests/ContentFilter.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sourcecode/hub/app/Http/Requests/ContentFilter.php b/sourcecode/hub/app/Http/Requests/ContentFilter.php index 5108539a2..00747cdac 100644 --- a/sourcecode/hub/app/Http/Requests/ContentFilter.php +++ b/sourcecode/hub/app/Http/Requests/ContentFilter.php @@ -312,8 +312,13 @@ private function attachModel(array $hits, bool $forUser, bool $showDrafts): Coll $eagerLoad[] = 'latestPublishedVersion'; } + $hitIds = collect($hits) + ->pluck('id') + ->filter + ->all(); + /** @phpstan-ignore-next-line */ - $contents = Content::whereIn('id', $hits->pluck('id')) + $contents = Content::whereIn('id', $hitIds) ->with($eagerLoad) ->withCount(['views']) ->get()