From 3f288da6477b169807ca4a208cb0fff945a2d4b0 Mon Sep 17 00:00:00 2001 From: Belisar Hoxholli Date: Tue, 8 Jul 2025 07:32:40 +0200 Subject: [PATCH] fix: switch to scoped registration --- src/MonitorServiceProvider.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/MonitorServiceProvider.php b/src/MonitorServiceProvider.php index 7a808e6..c273903 100644 --- a/src/MonitorServiceProvider.php +++ b/src/MonitorServiceProvider.php @@ -13,11 +13,11 @@ public function register(): void { $this->mergeConfigFrom(__DIR__.'/../config/monitor.php', 'monitor'); - $this->app->singleton(Monitor::class, fn () => new Monitor); - $this->app->singleton(Trace::class, fn () => new Trace); - $this->app->singleton(LogTimer::class, fn () => new LogTimer); - $this->app->singleton(CircuitBreaker::class, fn () => new CircuitBreaker); - $this->app->singleton(ControlledContext::class, fn () => new ControlledContext); + $this->app->scoped(Monitor::class, fn () => new Monitor); + $this->app->scoped(Trace::class, fn () => new Trace); + $this->app->scoped(LogTimer::class, fn () => new LogTimer); + $this->app->scoped(CircuitBreaker::class, fn () => new CircuitBreaker); + $this->app->scoped(ControlledContext::class, fn () => new ControlledContext); // Remove automatic logging channel merging - users should configure their own channels }