diff --git a/src/Providers/CacheServiceProvider.php b/src/Providers/CacheServiceProvider.php index 642dd7d46e..6a598cf431 100644 --- a/src/Providers/CacheServiceProvider.php +++ b/src/Providers/CacheServiceProvider.php @@ -46,6 +46,12 @@ private function extendFileStore() ), $this->app['config']['cache.stores.file']); }); + // Don't extend the file store if it's already being extended. + $creators = (fn () => $this->customCreators)->call(Cache::getFacadeRoot()); + if (isset($creators['file'])) { + return; + } + Cache::extend('file', function ($app, $config) { return Cache::repository( (new FileStore($app['files'], $config['path'], $config['permission'] ?? null))