mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-14 10:44:04 +00:00
Fix original prefix logic
This commit is contained in:
parent
8ea3cc9739
commit
1f1c7cc2bc
1 changed files with 4 additions and 2 deletions
|
|
@ -28,8 +28,10 @@ class PrefixCacheTenancyBootstrapper implements TenancyBootstrapper
|
||||||
|
|
||||||
public function bootstrap(Tenant $tenant): void
|
public function bootstrap(Tenant $tenant): void
|
||||||
{
|
{
|
||||||
|
$originalPrefix = $this->config->get('cache.prefix');
|
||||||
|
|
||||||
foreach (static::$tenantCacheStores as $store) {
|
foreach (static::$tenantCacheStores as $store) {
|
||||||
$this->originalPrefixes[$store] = $this->config->get('cache.prefix');
|
$this->originalPrefixes[$store] = $originalPrefix;
|
||||||
|
|
||||||
$this->setCachePrefix($store, $this->getStorePrefix($store, $tenant));
|
$this->setCachePrefix($store, $this->getStorePrefix($store, $tenant));
|
||||||
}
|
}
|
||||||
|
|
@ -62,7 +64,7 @@ class PrefixCacheTenancyBootstrapper implements TenancyBootstrapper
|
||||||
return static::$prefixGenerators[$store]($tenant);
|
return static::$prefixGenerators[$store]($tenant);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->config->get('cache.prefix', '') . config('tenancy.cache.prefix_base') . $tenant->getTenantKey();
|
return $this->originalPrefixes[$store] . config('tenancy.cache.prefix_base') . $tenant->getTenantKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function generatePrefixUsing(string $store, Closure $prefixGenerator): void
|
public static function generatePrefixUsing(string $store, Closure $prefixGenerator): void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue