44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Events\AuditionChange;
|
|
use App\Listeners\RefreshAuditionCache;
|
|
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
|
|
{
|
|
Event::listen(
|
|
AuditionChange::class,
|
|
RefreshAuditionCache::class
|
|
);
|
|
}
|
|
}
|