1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 17:24:03 +00:00
tenancy/tests/Etc/CacheService.php
2023-04-17 17:00:28 +02:00

24 lines
441 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');
}
}
}