1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 17:44:04 +00:00

Add check to invalidateCache()

This commit is contained in:
Samuel Štancl 2020-06-02 20:26:17 +02:00
parent 5d94727ddd
commit ba7257670f
4 changed files with 89 additions and 45 deletions

View file

@ -48,6 +48,10 @@ abstract class CachedTenantResolver implements TenantResolver
public function invalidateCache(Tenant $tenant): void
{
if (! static::$shouldCache) {
return;
}
foreach ($this->getArgsForTenant($tenant) as $args) {
$this->cache->forget($this->getCacheKey(...$args));
}