/** * Has * @param $key * @return bool */ public function has($key) { if ($this->cacheDriver == "file") { return $this->cache->has($key); } return $this->cache->tags($this->tag)->has($key); }
/** * Return the cache instance with tags attached * * @return \Illuminate\Cache\CacheManager */ protected function cache() { if (!method_exists($this->cache, 'tags')) { return $this->cache; } return $this->cache->tags($this->tag); }
/** * Load the inventory for a Steam ID * * @param integer $steamId * @param integer $appId * @param integer $contextId * @return Json */ public function loadInventory($steamId, $appId = 730, $contextId = 2) { if ($this->cache->tags($this->cacheTag)->has($steamId)) { $this->currentData = $this->cache->tags($this->cacheTag)->get($steamId); // Return the cached data return $this; } $inventory = $this->getSteamInventory($steamId, $appId, $contextId); if (is_array($inventory)) { $minutes = $this->cacheTime; $this->cache->tags($this->cacheTag)->put($steamId, $inventory, $minutes); $this->currentData = $inventory; } else { return false; } return $this; }
/** * Flush cache for tags. * * @param mixed $tags * * @return bool */ public function flush($tags = null) { if ($tags !== null) { $tags = is_array($tags) ? $tags : func_get_args(); } else { $tags = $this->tags; } return $this->cache->tags($tags)->flush(); }
/** * Get an item from the cache manager, or store the default value. * * @param string $key * @param \Closure $callback * * @return mixed */ public function getCache($key, Closure $callback) { // Skip cache for development if (config('app.debug')) { return $this->getLocalCache($key, $callback); } $key = $this->website->id . '-' . $key; $tags = $this->getCacheTags('pages'); return $this->cacheManager->tags($tags)->rememberForever($key, $callback); }
/** * Has * * @param string $key * @return bool */ public function has($key) { return $this->cache->tags($this->tag)->has($key); }
/** * @return mixed */ public function cacheTags() { return $this->cache->tags($this->tag); }
/** * @return void */ public function flush() { $this->cache->tags($this->cacheKey)->flush(); }
public function forgetByTags($tags) { return $this->cache->tags($tags)->flush(); }