*/ public function build(WebPortalContext $context): array { $cacheKey = WebPageCache::key('search', [ 'most-read', implode('-', $context->portalValues), $context->language, ]); return WebPageCache::remember($cacheKey, static function () use ($context): array { $mostReadReleases = PressRelease::query() ->withoutGlobalScope(PortalScope::class) ->forPortalValues($context->portalValues) ->forLanguage($context->language) ->visibleInArchive() ->orderByDesc('hits') ->orderByDesc('published_at') ->limit(5) ->get(['id', 'slug', 'title', 'hits', 'portal', 'language']); return [ 'portal' => $context->portal->value, 'language' => $context->language, 'mostReadReleases' => $mostReadReleases, ]; }); } }