diff --git a/src/Services/SwaggerService.php b/src/Services/SwaggerService.php index 328213a5..f06494f9 100755 --- a/src/Services/SwaggerService.php +++ b/src/Services/SwaggerService.php @@ -38,10 +38,10 @@ class SwaggerService public function __construct(Container $container) { - $this->setDriver(); - $this->config = config('auto-doc'); + $this->setDriver(); + if (config('app.env') == 'testing') { $this->container = $container; @@ -59,8 +59,8 @@ public function __construct(Container $container) protected function setDriver() { - $driver = config('auto-doc.driver'); - $className = config("auto-doc.drivers.{$driver}.class"); + $driver = $this->config['driver']; + $className = Arr::get($this->config, "drivers.{$driver}.class"); if (!class_exists($className)) { throw new SwaggerDriverClassNotFoundException($className);