1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-06 10:34:04 +00:00

extract getTenantPrefix method

This commit is contained in:
Samuel Štancl 2022-09-02 17:16:57 +02:00 committed by GitHub
parent 94adb43f7b
commit e2ee9ec653
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,11 +27,16 @@ class ScoutTenancyBootstrapper implements TenancyBootstrapper
$this->originalScoutPrefix = $this->config->get('scout.prefix'); $this->originalScoutPrefix = $this->config->get('scout.prefix');
} }
$this->config->set('scout.prefix', $tenant->getTenantKey()); $this->config->set('scout.prefix', $this->getTenantPrefix($tenant));
} }
public function revert() public function revert()
{ {
$this->config->set('scout.prefix', $this->originalScoutPrefix); $this->config->set('scout.prefix', $this->originalScoutPrefix);
} }
protected function getTenantPrefix(Tenant $tenant): string
{
return (string) $tenant->getTenantKey();
}
} }