Skip to content

Commit

Permalink
fix: cacheForgetByKey
Browse files Browse the repository at this point in the history
  • Loading branch information
efureev committed Jun 29, 2022
1 parent 50cceb5 commit 0e136ba
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Traits/Models/HasModelEntityCache.php
Expand Up @@ -42,9 +42,16 @@ protected static function cacheForget(Model $model): bool
return true;
}

return Cache::forget(
static::cachePrefixKey($model->{static::cacheKeyName()})
);
return static::cacheForgetByKey($model->{static::cacheKeyName()});
}

public static function cacheForgetByKey(string $key): bool
{
if (!static::$cacheEnable) {
return true;
}

return Cache::forget(static::cachePrefixKey($key));
}

protected static function cacheForgetCollection(string $key = 'list:*'): bool
Expand Down

0 comments on commit 0e136ba

Please sign in to comment.