77 lines
2.3 KiB
PHP
77 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Events\AuditionChange;
|
|
use App\Listeners\RefreshAuditionCache;
|
|
use App\Models\Audition;
|
|
use App\Models\Entry;
|
|
use App\Models\Room;
|
|
use App\Models\RoomUser;
|
|
use App\Models\School;
|
|
use App\Models\ScoreSheet;
|
|
use App\Models\ScoringGuide;
|
|
use App\Models\Student;
|
|
use App\Models\SubscoreDefinition;
|
|
use App\Models\User;
|
|
use App\Observers\AuditionObserver;
|
|
use App\Observers\EntryObserver;
|
|
use App\Observers\RoomObserver;
|
|
use App\Observers\RoomUserObserver;
|
|
use App\Observers\SchoolObserver;
|
|
use App\Observers\ScoreSheetObserver;
|
|
use App\Observers\ScoringGuideObserver;
|
|
use App\Observers\StudentObserver;
|
|
use App\Observers\SubscoreDefinitionObserver;
|
|
use App\Observers\UserObserver;
|
|
use App\Services\AuditionCacheService;
|
|
use App\Services\DoublerService;
|
|
use App\Services\TabulationService;
|
|
use Illuminate\Support\Facades\Event;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
$this->app->singleton(AuditionCacheService::class, function () {
|
|
return new AuditionCacheService();
|
|
});
|
|
|
|
$this->app->singleton(TabulationService::class, function($app) {
|
|
return new TabulationService($app->make(AuditionCacheService::class));
|
|
});
|
|
|
|
$this->app->singleton(DoublerService::class, function($app) {
|
|
return new DoublerService($app->make(AuditionCacheService::class),$app->make(TabulationService::class));
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
|
|
Entry::observe(EntryObserver::class);
|
|
Audition::observe(AuditionObserver::class);
|
|
Room::observe(RoomObserver::class);
|
|
RoomUser::observe(RoomUserObserver::class);
|
|
School::observe(SchoolObserver::class);
|
|
ScoreSheet::observe(ScoreSheetObserver::class);
|
|
ScoringGuide::observe(ScoringGuideObservers::class);
|
|
Student::observe(StudentObserver::class);
|
|
SubscoreDefinition::observe(SubscoreDefinitionObserver::class);
|
|
User::observe(UserObserver::class);
|
|
|
|
|
|
Event::listen(
|
|
AuditionChange::class,
|
|
RefreshAuditionCache::class
|
|
);
|
|
}
|
|
}
|