108 lines
3.4 KiB
PHP
108 lines
3.4 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Events\AuditionChange;
|
|
use App\Events\EntryChange;
|
|
use App\Events\ScoreSheetChange;
|
|
use App\Events\ScoringGuideChange;
|
|
use App\Events\SeatingLimitChange;
|
|
use App\Listeners\RefreshAuditionCache;
|
|
use App\Listeners\RefreshEntryCache;
|
|
use App\Listeners\RefreshScoreSheetCache;
|
|
use App\Listeners\RefreshScoringGuideCache;
|
|
use App\Listeners\RefreshSeatingLimitCache;
|
|
use App\Models\Audition;
|
|
use App\Models\Entry;
|
|
use App\Models\Room;
|
|
use App\Models\RoomUser;
|
|
use App\Models\School;
|
|
use App\Models\ScoringGuide;
|
|
use App\Models\SeatingLimit;
|
|
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\SeatingLimitObserver;
|
|
use App\Observers\StudentObserver;
|
|
use App\Observers\SubscoreDefinitionObserver;
|
|
use App\Observers\UserObserver;
|
|
use App\Services\AuditionService;
|
|
use App\Services\DoublerService;
|
|
use App\Services\DrawService;
|
|
use App\Services\EntryService;
|
|
use App\Services\ScoreService;
|
|
use App\Services\SeatingService;
|
|
use App\Services\TabulationService;
|
|
use Illuminate\Support\Facades\Event;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use App\Models\ScoreSheet;
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
$this->app->singleton(DrawService::class, function () {
|
|
return new DrawService();
|
|
});
|
|
|
|
$this->app->singleton(AuditionService::class, function () {
|
|
return new AuditionService();
|
|
});
|
|
|
|
$this->app->singleton(SeatingService::class, function ($app) {
|
|
return new SeatingService($app->make(TabulationService::class));
|
|
});
|
|
|
|
$this->app->singleton(EntryService::class, function ($app) {
|
|
return new EntryService($app->make(AuditionService::class));
|
|
});
|
|
|
|
$this->app->singleton(ScoreService::class, function ($app) {
|
|
return new ScoreService($app->make(AuditionService::class), $app->make(EntryService::class));
|
|
});
|
|
|
|
$this->app->singleton(TabulationService::class, function ($app) {
|
|
return new TabulationService(
|
|
$app->make(AuditionService::class),
|
|
$app->make(ScoreService::class),
|
|
$app->make(EntryService::class));
|
|
});
|
|
|
|
$this->app->singleton(DoublerService::class, function ($app) {
|
|
return new DoublerService($app->make(AuditionService::class), $app->make(TabulationService::class), $app->make(SeatingService::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(ScoringGuideObserver::class);
|
|
Student::observe(StudentObserver::class);
|
|
SubscoreDefinition::observe(SubscoreDefinitionObserver::class);
|
|
User::observe(UserObserver::class);
|
|
SeatingLimit::observe(SeatingLimitObserver::class);
|
|
|
|
|
|
}
|
|
}
|