Test and update

This commit is contained in:
Matt Young 2024-06-12 22:43:47 -05:00
parent d8e20d5f64
commit 008cf0e7b0
4 changed files with 18 additions and 14 deletions

View File

@ -127,3 +127,5 @@ class ScoringGuideController extends Controller
}
}
// TODO need to be able to delete a scoring guide

View File

@ -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'));
}
}

View File

@ -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();
}
}

View File

@ -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 @@
<x-slot:page_title>Test Page</x-slot:page_title>
@php
$a = Audition::find(9);
dump ($a->rankedEntries());
dump ($a->rankedEntries());
dump ($a->rankedEntries());
dump($sg);
@endphp
</x-layout.app>