Skip to content

Commit da37ca9

Browse files
authored
fix(laravel): default to file cache instead of cache.default (#6955)
Use the `api-platform.cache` configuration to change it.
1 parent e041d72 commit da37ca9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Laravel/ApiPlatformProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public function register(): void
319319
$app->make(ResourceClassResolverInterface::class)
320320
),
321321
),
322-
true === $config->get('app.debug') ? 'array' : $config->get('cache.default', 'file')
322+
true === $config->get('app.debug') ? 'array' : $config->get('api-platform.cache', 'file')
323323
);
324324
});
325325

@@ -337,7 +337,7 @@ public function register(): void
337337
)
338338
)
339339
),
340-
true === $config->get('app.debug') ? 'array' : $config->get('cache.default', 'file')
340+
true === $config->get('app.debug') ? 'array' : $config->get('api-platform.cache', 'file')
341341
);
342342
});
343343

@@ -408,7 +408,7 @@ public function register(): void
408408
$app->make('filters')
409409
)
410410
),
411-
true === $config->get('app.debug') ? 'array' : $config->get('cache.default', 'file')
411+
true === $config->get('app.debug') ? 'array' : $config->get('api-platform.cache', 'file')
412412
);
413413
});
414414

src/Laravel/config/api-platform.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,8 @@
118118
'serializer' => [
119119
'hydra_prefix' => false,
120120
// 'datetime_format' => \DateTimeInterface::RFC3339
121-
]
121+
],
122+
123+
// we recommend using "file" or "acpu"
124+
'cache' => 'file'
122125
];

0 commit comments

Comments
 (0)