mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 09:34:05 +00:00
Check cache store support for tags
This commit is contained in:
parent
1a5300ab4f
commit
aa7291ba05
1 changed files with 4 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ class CacheManager extends BaseCacheManager
|
|||
public function __call($method, $parameters)
|
||||
{
|
||||
$tags = [config('tenancy.cache.tag_base') . tenant()->getTenantKey()];
|
||||
$supportTags = $this->store()->getStore() instanceof \Illuminate\Cache\TaggableStore;
|
||||
|
||||
if ($method === 'tags') {
|
||||
if (count($parameters) !== 1) {
|
||||
|
|
@ -30,6 +31,8 @@ class CacheManager extends BaseCacheManager
|
|||
return $this->store()->tags(array_merge($tags, $names));
|
||||
}
|
||||
|
||||
return $this->store()->tags($tags)->$method(...$parameters);
|
||||
return $supportTags
|
||||
? $this->store()->tags($tags)->$method(...$parameters)
|
||||
: $this->store()->$method(...$parameters);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue