Make sure a tags method exists before calling it

parent 48df3584
......@@ -175,9 +175,13 @@ abstract class BaseCacheDecorator implements BaseRepository
{
$cacheKey = $this->makeCacheKey($key);
return $this->cache
->tags([$this->entityName, 'global'])
->remember($cacheKey, $this->cacheTime, $callback);
$store = $this->cache;
if (method_exists($this->cache->getStore(), 'tags')) {
$store = $store->tags([$this->entityName, 'global']);
}
return $store->remember($cacheKey, $this->cacheTime, $callback);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment