From ddd4632509e0c1f775f942df1b92417a045c69f5 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Thu, 13 Jun 2024 00:28:03 -0500 Subject: [PATCH] Add singular audition method to audition cache service --- app/Http/Controllers/TestController.php | 6 +++--- app/Services/AuditionCacheService.php | 5 +++++ app/Services/TabulationService.php | 14 ++++++++++++++ resources/views/test.blade.php | 8 ++++++-- 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 app/Services/TabulationService.php diff --git a/app/Http/Controllers/TestController.php b/app/Http/Controllers/TestController.php index 7fdc58d..ed9878f 100644 --- a/app/Http/Controllers/TestController.php +++ b/app/Http/Controllers/TestController.php @@ -17,8 +17,8 @@ class TestController extends Controller public function flashTest(Request $request) { - $sg = $this->scoringGuideCacheService->getAuditions(); - - return view('test', compact('sg')); + $auditions = $this->scoringGuideCacheService->getAuditions(); + $auditionEleven = $this->scoringGuideCacheService->getAudition(11); + return view('test', compact('auditions','auditionEleven')); } } diff --git a/app/Services/AuditionCacheService.php b/app/Services/AuditionCacheService.php index b32c4aa..f90e9d2 100644 --- a/app/Services/AuditionCacheService.php +++ b/app/Services/AuditionCacheService.php @@ -24,6 +24,11 @@ class AuditionCacheService }); } + public function getAudition($id) + { + return $this->getAuditions()->firstWhere('id',$id); + } + public function refreshCache() { Cache::forget($this->cacheKey); diff --git a/app/Services/TabulationService.php b/app/Services/TabulationService.php new file mode 100644 index 0000000..b25c6d4 --- /dev/null +++ b/app/Services/TabulationService.php @@ -0,0 +1,14 @@ +Test Page @php - dump($sg); + dump($auditionEleven); + $auditions->load('entries.scoreSheets'); + dump($auditions); @endphp - + @foreach($auditions as $a) + {{$a->entries->count()}}
+ @endforeach