39 lines
1007 B
PHP
39 lines
1007 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\DepartmentPatient;
|
|
use App\Models\ReportDuty;
|
|
use App\Models\ReportNurse;
|
|
use App\Observers\DepartmentPatientObserver;
|
|
use App\Observers\ReportDutyObserver;
|
|
use App\Observers\ReportNurseObserver;
|
|
use App\Services\Cache\CacheInvalidator;
|
|
use App\Services\Cache\CacheKeyBuilder;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
$this->app->singleton(CacheKeyBuilder::class, function () {
|
|
return new CacheKeyBuilder(version: 'v1');
|
|
});
|
|
|
|
$this->app->singleton(CacheInvalidator::class);
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
ReportNurse::observe(ReportNurseObserver::class);
|
|
ReportDuty::observe(ReportDutyObserver::class);
|
|
DepartmentPatient::observe(DepartmentPatientObserver::class);
|
|
}
|
|
}
|