diff --git a/src/LogViewerServiceProvider.php b/src/LogViewerServiceProvider.php index 40eca267..20827996 100644 --- a/src/LogViewerServiceProvider.php +++ b/src/LogViewerServiceProvider.php @@ -32,13 +32,15 @@ public function register() { $this->mergeConfigFrom(self::basePath("/config/{$this->name}.php"), $this->name); - $this->app->bind('log-viewer', LogViewerService::class); - $this->app->bind('log-viewer-cache', function () { + $bindMethod = method_exists($this->app, 'scoped') ? 'scoped' : 'singleton'; + + $this->app->$bindMethod('log-viewer', LogViewerService::class); + $this->app->$bindMethod('log-viewer-cache', function () { return Cache::driver(config('log-viewer.cache_driver')); }); if (! $this->app->bound(LogTypeRegistrar::class)) { - $this->app->singleton(LogTypeRegistrar::class, function () { + $this->app->$bindMethod(LogTypeRegistrar::class, function () { return new LogTypeRegistrar; }); }