Files
onboard/app/Providers/AppServiceProvider.php
2026-07-31 17:19:03 +09:00

46 lines
1.2 KiB
PHP

<?php
namespace App\Providers;
use App\Domain\Patient\Contracts\PatientRepositoryInterface;
use App\Infrastructure\Database\Repositories\Patient\PatientRepository;
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);
$this->app->bind(
PatientRepositoryInterface::class,
PatientRepository::class
);
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
ReportNurse::observe(ReportNurseObserver::class);
ReportDuty::observe(ReportDutyObserver::class);
DepartmentPatient::observe(DepartmentPatientObserver::class);
}
}