diff --git a/src/Laravel/ApiPlatformProvider.php b/src/Laravel/ApiPlatformProvider.php index 0a9272b5572..a9725ebdbea 100644 --- a/src/Laravel/ApiPlatformProvider.php +++ b/src/Laravel/ApiPlatformProvider.php @@ -297,7 +297,7 @@ public function register(): void }); $this->app->extend(PropertyMetadataFactoryInterface::class, function (PropertyInfoPropertyMetadataFactory $inner, Application $app) { - /** @var ConfigRepository */ + /** @var ConfigRepository $config */ $config = $app['config']; return new CachePropertyMetadataFactory( @@ -313,12 +313,12 @@ public function register(): void $app->make(ResourceClassResolverInterface::class) ), ), - true === $config->get('app.debug') ? 'array' : 'file' + true === $config->get('app.debug') ? 'array' : $config->get('cache.default', 'file') ); }); $this->app->singleton(PropertyNameCollectionFactoryInterface::class, function (Application $app) { - /** @var ConfigRepository */ + /** @var ConfigRepository $config */ $config = $app['config']; return new CachePropertyNameCollectionMetadataFactory( @@ -331,7 +331,7 @@ public function register(): void ) ) ), - true === $config->get('app.debug') ? 'array' : 'file' + true === $config->get('app.debug') ? 'array' : $config->get('cache.default', 'file') ); }); @@ -345,7 +345,7 @@ public function register(): void // TODO: add cached metadata factories $this->app->singleton(ResourceMetadataCollectionFactoryInterface::class, function (Application $app) { - /** @var ConfigRepository */ + /** @var ConfigRepository $config */ $config = $app['config']; $formats = $config->get('api-platform.formats'); @@ -401,7 +401,7 @@ public function register(): void $app->make('filters') ) ), - true === $config->get('app.debug') ? 'array' : 'file' + true === $config->get('app.debug') ? 'array' : $config->get('cache.default', 'file') ); }); diff --git a/src/Laravel/workbench/app/Providers/WorkbenchServiceProvider.php b/src/Laravel/workbench/app/Providers/WorkbenchServiceProvider.php index a6237450d1c..eb0d9f4d5ce 100644 --- a/src/Laravel/workbench/app/Providers/WorkbenchServiceProvider.php +++ b/src/Laravel/workbench/app/Providers/WorkbenchServiceProvider.php @@ -32,6 +32,7 @@ public function register(): void { $config = $this->app['config']; $config->set('api-platform.resources', [app_path('Models'), app_path('ApiResource')]); + $config->set('cache.default', 'null'); } /**