mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 04:24:03 +00:00
Update CacheManager, add refreshStore()
This commit is contained in:
parent
9ec0b6dae3
commit
d364568e53
1 changed files with 23 additions and 10 deletions
|
|
@ -18,7 +18,9 @@ class CacheManager extends BaseCacheManager
|
|||
*/
|
||||
public function __call($method, $parameters)
|
||||
{
|
||||
$tags = [config('tenancy.cache.tag_base') . tenant()->getTenantKey()];
|
||||
// todo0 Make PrefixCacheTenancyBootstrapper work with tags
|
||||
/* if (tenancy()->initialized) {
|
||||
$tags = [config('tenancy.cache.tag_base') . tenant()?->getTenantKey()];
|
||||
|
||||
if ($method === 'tags') {
|
||||
$count = count($parameters);
|
||||
|
|
@ -34,5 +36,16 @@ class CacheManager extends BaseCacheManager
|
|||
}
|
||||
|
||||
return $this->store()->tags($tags)->$method(...$parameters);
|
||||
} */
|
||||
|
||||
return parent::__call($method, $parameters);
|
||||
}
|
||||
|
||||
|
||||
public function refreshStore(string|null $repository = null): void
|
||||
{
|
||||
$newStore = $this->resolve($repository ?? $this->getDefaultDriver())->getStore();
|
||||
|
||||
$this->driver($repository)->setStore($newStore);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue