1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 23:54:04 +00:00
tenancy/tests/Etc/CacheAction.php
2022-12-01 13:53:45 +05:00

24 lines
443 B
PHP

<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Tests\Etc;
use Illuminate\Cache\CacheManager;
class CacheAction
{
public function __construct(
protected CacheManager $cache
){
}
public function handle(): void
{
if (tenancy()->initialized) {
$this->cache->put('key', tenant()->getTenantKey());
} else {
$this->cache->put('key', 'central-value');
}
}
}