Add singular audition method to audition cache service

This commit is contained in:
Matt Young 2024-06-13 00:28:03 -05:00
parent ff85fd1c86
commit ddd4632509
4 changed files with 28 additions and 5 deletions

View File

@ -17,8 +17,8 @@ class TestController extends Controller
public function flashTest(Request $request) public function flashTest(Request $request)
{ {
$sg = $this->scoringGuideCacheService->getAuditions(); $auditions = $this->scoringGuideCacheService->getAuditions();
$auditionEleven = $this->scoringGuideCacheService->getAudition(11);
return view('test', compact('sg')); return view('test', compact('auditions','auditionEleven'));
} }
} }

View File

@ -24,6 +24,11 @@ class AuditionCacheService
}); });
} }
public function getAudition($id)
{
return $this->getAuditions()->firstWhere('id',$id);
}
public function refreshCache() public function refreshCache()
{ {
Cache::forget($this->cacheKey); Cache::forget($this->cacheKey);

View File

@ -0,0 +1,14 @@
<?php
namespace App\Services;
class TabulationService
{
/**
* Create a new class instance.
*/
public function __construct()
{
//
}
}

View File

@ -13,8 +13,12 @@
<x-slot:page_title>Test Page</x-slot:page_title> <x-slot:page_title>Test Page</x-slot:page_title>
@php @php
dump($sg); dump($auditionEleven);
$auditions->load('entries.scoreSheets');
dump($auditions);
@endphp @endphp
@foreach($auditions as $a)
{{$a->entries->count()}}<hr>
@endforeach
</x-layout.app> </x-layout.app>