1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 21:54:03 +00:00

Improve CacheManager

This commit is contained in:
lukinovec 2023-04-12 07:17:29 +02:00
parent 70051e70b3
commit 2d0ee2c7cd

View file

@ -20,10 +20,15 @@ class CacheManager extends BaseCacheManager
*/
public function __call($method, $parameters)
{
if (! tenancy()->initialized || ! static::$addTags) {
return parent::__call($method, $parameters);
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()];
if ($method === 'tags') {