diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index f38bdfe..6e1fd8e 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -1,4 +1,4 @@ -app; - + $configPath = __DIR__ . '/../config/httpcache.php'; $this->mergeConfigFrom($configPath, 'httpcache'); - + if (function_exists('config_path')) { $this->publishes([$configPath => config_path('httpcache.php')], 'config'); } @@ -67,6 +67,10 @@ public function boot() { $this->app->make(StackMiddleware::class)->bind(CacheRequests::class, function($app) { + if(! $this->app['config']->get('httpcache.enabled')) { + return $app; + } + return new HttpCache( $app, $this->app->make(StoreInterface::class),