1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-14 20:44:03 +00:00

Automatic mode

This commit is contained in:
Samuel Štancl 2020-05-10 23:47:11 +02:00
parent 2492345280
commit 73fc525126
16 changed files with 154 additions and 40 deletions

View file

@ -7,7 +7,7 @@ namespace Stancl\Tenancy\TenancyBootstrappers;
use Illuminate\Contracts\Config\Repository;
use Illuminate\Support\Facades\Redis;
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
use Stancl\Tenancy\Tenant;
use Stancl\Tenancy\Contracts\Tenant;
class RedisTenancyBootstrapper implements TenancyBootstrapper
{
@ -25,7 +25,7 @@ class RedisTenancyBootstrapper implements TenancyBootstrapper
public function start(Tenant $tenant)
{
foreach ($this->prefixedConnections() as $connection) {
$prefix = $this->config['tenancy.redis.prefix_base'] . $tenant['id'];
$prefix = $this->config['tenancy.redis.prefix_base'] . $tenant->getTenantKey();
$client = Redis::connection($connection)->client();
$this->originalPrefixes[$connection] = $client->getOption($client::OPT_PREFIX);