File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
- <?php
1
+ <?php
2
2
3
3
namespace Barryvdh \HttpCache ;
4
4
@@ -28,10 +28,10 @@ class ServiceProvider extends BaseServiceProvider
28
28
public function register ()
29
29
{
30
30
$ app = $ this ->app ;
31
-
31
+
32
32
$ configPath = __DIR__ . '/../config/httpcache.php ' ;
33
33
$ this ->mergeConfigFrom ($ configPath , 'httpcache ' );
34
-
34
+
35
35
if (function_exists ('config_path ' )) {
36
36
$ this ->publishes ([$ configPath => config_path ('httpcache.php ' )], 'config ' );
37
37
}
@@ -67,6 +67,10 @@ public function boot()
67
67
{
68
68
$ this ->app ->make (StackMiddleware::class)->bind (CacheRequests::class,
69
69
function ($ app ) {
70
+ if (! $ this ->app ['config ' ]->get ('httpcache.enabled ' )) {
71
+ return $ app ;
72
+ }
73
+
70
74
return new HttpCache (
71
75
$ app ,
72
76
$ this ->app ->make (StoreInterface::class),
You can’t perform that action at this time.
0 commit comments