mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 22:14:03 +00:00
24 lines
440 B
PHP
24 lines
440 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy\Tests\Etc;
|
|
|
|
use Illuminate\Cache\Repository;
|
|
|
|
class CacheService
|
|
{
|
|
public function __construct(
|
|
protected Repository $cache
|
|
){
|
|
}
|
|
|
|
public function handle(): void
|
|
{
|
|
if (tenancy()->initialized) {
|
|
$this->cache->put('key', tenant()->getTenantKey());
|
|
} else {
|
|
$this->cache->put('key', 'central-value');
|
|
}
|
|
}
|
|
}
|