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

cache prefix base from config

This commit is contained in:
Abrar Ahmad 2022-11-22 11:32:23 +05:00
parent 90c54ac733
commit e5658fa300
2 changed files with 2 additions and 1 deletions

View file

@ -188,6 +188,7 @@ return [
*/
'cache' => [
'tag_base' => 'tenant', // This tag_base, followed by the tenant_id, will form a tag that will be applied on each cache call.
'prefix_base' => 'tenant_' // this prefix_base, followed by the tenant_id, will form a cache prefix that will be applied on each cache call
],
/**

View file

@ -25,7 +25,7 @@ class PrefixCacheTenancyBootstrapper implements TenancyBootstrapper
$this->originalPrefix = $this->app['config']['cache.prefix'];
$this->storeName = $this->app['config']['cache.default'];
$this->setCachePrefix('tenant_id_' . $tenant->id);
$this->setCachePrefix($this->app['config']['tenancy.cache.prefix_base'] . $tenant->id);
}
public function revert(): void