mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 04:24:03 +00:00
Improve CacheManager
This commit is contained in:
parent
70051e70b3
commit
2d0ee2c7cd
1 changed files with 7 additions and 2 deletions
|
|
@ -20,10 +20,15 @@ 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 parent::__call($method, $parameters);
|
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') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue