mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-14 02:04:03 +00:00
Rename CacheManagerService
This commit is contained in:
parent
52db2a0c06
commit
d945d1facc
1 changed files with 3 additions and 3 deletions
|
|
@ -1,27 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Tests\Etc;
|
||||
|
||||
use Illuminate\Cache\CacheManager;
|
||||
use Illuminate\Cache\Repository;
|
||||
|
||||
class CacheManagerService
|
||||
{
|
||||
public Repository $cache;
|
||||
|
||||
public function __construct(CacheManager $cacheManager)
|
||||
{
|
||||
$this->cache = $cacheManager->driver('redis2');
|
||||
}
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
if (tenancy()->initialized) {
|
||||
$this->cache->put('key', tenant()->getTenantKey());
|
||||
} else {
|
||||
$this->cache->put('key', 'central-value');
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue