We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19bcdf2 commit da53fccCopy full SHA for da53fcc
src/Traits/Caching.php
@@ -263,6 +263,10 @@ protected function checkCooldownAndRemoveIfExpired(Model $instance)
263
264
protected function checkCooldownAndFlushAfterPersisting(Model $instance, string $relationship = "")
265
{
266
+ if (!$this->isCachable()) {
267
+ return;
268
+ }
269
+
270
[$cacheCooldown, $invalidatedAt] = $instance->getModelCacheCooldown($instance);
271
272
if (! $cacheCooldown) {
@@ -295,6 +299,10 @@ public function isCachable() : bool
295
299
$isCacheDisabled = ! Container::getInstance()
296
300
->make("config")
297
301
->get("laravel-model-caching.enabled");
302
+ if ($isCacheDisabled) {
303
+ return false;
304
305
298
306
$allRelationshipsAreCachable = true;
307
308
if (
@@ -327,7 +335,6 @@ public function isCachable() : bool
327
335
}
328
336
329
337
return $this->isCachable
330
- && ! $isCacheDisabled
331
338
&& $allRelationshipsAreCachable;
332
339
333
340
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments