mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 02:44:02 +00:00
Move logic from separate method to __call
This commit is contained in:
parent
2d0ee2c7cd
commit
940fb1744b
1 changed files with 16 additions and 21 deletions
|
|
@ -21,14 +21,6 @@ class CacheManager extends BaseCacheManager
|
||||||
public function __call($method, $parameters)
|
public function __call($method, $parameters)
|
||||||
{
|
{
|
||||||
if (tenancy()->initialized && static::$addTags) {
|
if (tenancy()->initialized && static::$addTags) {
|
||||||
return $this->callWithTag($method, $parameters);
|
|
||||||
}
|
|
||||||
|
|
||||||
return parent::__call($method, $parameters);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function callWithTag($method, $parameters)
|
|
||||||
{
|
|
||||||
$tags = [config('tenancy.cache.tag_base') . tenant()?->getTenantKey()];
|
$tags = [config('tenancy.cache.tag_base') . tenant()?->getTenantKey()];
|
||||||
|
|
||||||
if ($method === 'tags') {
|
if ($method === 'tags') {
|
||||||
|
|
@ -46,4 +38,7 @@ class CacheManager extends BaseCacheManager
|
||||||
|
|
||||||
return $this->store()->tags($tags)->$method(...$parameters);
|
return $this->store()->tags($tags)->$method(...$parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return parent::__call($method, $parameters);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue