diff --git a/app/Http/Controllers/Admin/ScoringGuideController.php b/app/Http/Controllers/Admin/ScoringGuideController.php index 374824b..a211648 100644 --- a/app/Http/Controllers/Admin/ScoringGuideController.php +++ b/app/Http/Controllers/Admin/ScoringGuideController.php @@ -127,3 +127,5 @@ class ScoringGuideController extends Controller } } + +// TODO need to be able to delete a scoring guide diff --git a/app/Http/Controllers/TestController.php b/app/Http/Controllers/TestController.php index 1d19cbc..2bf33cc 100644 --- a/app/Http/Controllers/TestController.php +++ b/app/Http/Controllers/TestController.php @@ -2,18 +2,23 @@ namespace App\Http\Controllers; +use App\Services\ScoringGuideCacheService; use Illuminate\Http\Request; use Illuminate\Support\Facades\Session; class TestController extends Controller { + protected $scoringGuideCacheService; + + public function __construct(ScoringGuideCacheService $scoringGuideCacheService) + { + $this->scoringGuideCacheService = $scoringGuideCacheService; + } + public function flashTest(Request $request) { + $sg = $this->scoringGuideCacheService->getScoringGuides(); - Session::flash('msg|this is the message','success'); - Session::flash('msg|another message','caution'); - Session::flash('msg|you better be careful','danger'); - - return view('test'); + return view('test', compact('sg')); } } diff --git a/app/Listeners/RefreshScoringGuideCache.php b/app/Listeners/RefreshScoringGuideCache.php index f7480c2..7f88d01 100644 --- a/app/Listeners/RefreshScoringGuideCache.php +++ b/app/Listeners/RefreshScoringGuideCache.php @@ -9,12 +9,13 @@ use Illuminate\Queue\InteractsWithQueue; class RefreshScoringGuideCache { + protected $cacheService; /** * Create the event listener. */ - public function __construct() + public function __construct(ScoringGuideCacheService $cacheService) { - // + $this->cacheService = $cacheService; } /** @@ -22,7 +23,7 @@ class RefreshScoringGuideCache */ public function handle(ScoringGuideChange $event): void { - ScoringGuideCacheService::refreshCache(); + $this->cacheService->refreshCache(); } } diff --git a/resources/views/test.blade.php b/resources/views/test.blade.php index abd7fbd..e6faabe 100644 --- a/resources/views/test.blade.php +++ b/resources/views/test.blade.php @@ -4,7 +4,7 @@ use App\Models\SchoolEmailDomain; use App\Models\ScoreSheet; use App\Models\ScoringGuide; - use App\Models\User;use App\Settings; + use App\Models\User;use App\Services\ScoringGuideCacheService;use App\Settings; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Session; @@ -13,12 +13,8 @@ Test Page @php - $a = Audition::find(9); - dump ($a->rankedEntries()); - dump ($a->rankedEntries()); - dump ($a->rankedEntries()); + dump($sg); @endphp -