From 2cbf00b1d75f7260dbf0672dab1eb9d6edf830af Mon Sep 17 00:00:00 2001 From: Matt Young Date: Mon, 24 Jun 2024 23:49:41 -0500 Subject: [PATCH] When caching published auditions, get auditions with flags in inital query --- app/Services/AuditionCacheService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/AuditionCacheService.php b/app/Services/AuditionCacheService.php index 3c7b261..bbe22c9 100644 --- a/app/Services/AuditionCacheService.php +++ b/app/Services/AuditionCacheService.php @@ -67,7 +67,7 @@ class AuditionCacheService $cacheKey, now()->addHour(), function () { - return Audition::orderBy('score_order')->get()->filter(fn ($audition) => $audition->hasFlag('seats_published')); + return Audition::with('flags')->orderBy('score_order')->get()->filter(fn ($audition) => $audition->hasFlag('seats_published')); }); }