diff --git a/src/Laravel/ApiPlatformProvider.php b/src/Laravel/ApiPlatformProvider.php index d11885ab54..815bb3fd80 100644 --- a/src/Laravel/ApiPlatformProvider.php +++ b/src/Laravel/ApiPlatformProvider.php @@ -279,7 +279,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( @@ -295,12 +295,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( @@ -313,7 +313,7 @@ public function register(): void ) ) ), - true === $config->get('app.debug') ? 'array' : 'file' + true === $config->get('app.debug') ? 'array' : $config->get('cache.default', 'file') ); }); @@ -327,7 +327,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'); @@ -382,7 +382,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 a6237450d1..eb0d9f4d5c 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'); } /**