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

Disable cache tagging by default, add CacheTagBootstrapper

This commit is contained in:
lukinovec 2023-04-11 14:28:28 +02:00
parent 5849afa4c8
commit 7ebfc375d6
5 changed files with 31 additions and 12 deletions

View file

@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Bootstrappers;
use Stancl\Tenancy\CacheManager;
use Stancl\Tenancy\Contracts\Tenant;
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
class CacheTagBootstrapper implements TenancyBootstrapper
{
public function bootstrap(Tenant $tenant): void
{
CacheManager::$addTags = true;
}
public function revert(): void
{
CacheManager::$addTags = false;
}
}

View file

@ -10,7 +10,7 @@ use Illuminate\Cache\CacheManager as BaseCacheManager;
class CacheManager extends BaseCacheManager
{
public static bool $addTags = true;
public static bool $addTags = false;
/**
* Add tags and forward the call to the inner cache store.