/** * Return the cache instance with tags attached. * * @return \Illuminate\Contracts\Cache\Repository|\Illuminate\Contracts\Cache\Store */ protected function cache() { if (!method_exists($this->cache, 'tags')) { return $this->cache; } return $this->cache->tags($this->tag); }
/** * @param UrlGenerator $url * @param Store $cache * @param null $publicFolder */ public function __construct(UrlGenerator $url, Store $cache, $publicFolder = null) { $this->url = $url; $this->cache = $cache; if (method_exists($this->cache, 'tags')) { $this->cache = $cache->tags('arrounded.meta'); } $this->publicFolder = $publicFolder; }
/** * Begin executing a new tags operation if the store supports it. * * @param array|mixed $names * @return \Illuminate\Cache\TaggedCache * * @throws \BadMethodCallException */ public function tags($names) { if (method_exists($this->store, 'tags')) { $taggedCache = $this->store->tags($names); if (!is_null($this->events)) { $taggedCache->setEventDispatcher($this->events); } $taggedCache->setDefaultCacheTime($this->default); return $taggedCache; } throw new BadMethodCallException('This cache store does not support tagging.'); }
/** * Completely clear the cache * * @return void */ public function clear() { $this->store->tags([$this->cacheTag])->flush(); }