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:
parent
5849afa4c8
commit
7ebfc375d6
5 changed files with 31 additions and 12 deletions
22
src/Bootstrappers/CacheTagBootstrapper.php
Normal file
22
src/Bootstrappers/CacheTagBootstrapper.php
Normal 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue