コード例 #1
0
 /**
  * @param $name
  *
  * @return Sidebar
  */
 public function resolve($name)
 {
     $duration = $this->config->get('sidebar.cache.duration');
     return $this->cache->remember(CacheKey::get($name), $duration, function () use($name) {
         return $this->resolver->resolve($name);
     });
 }
コード例 #2
0
 /**
  * @param $name
  *
  * @return Sidebar
  */
 public function resolve($name)
 {
     if ((new SupportsCacheTags())->isSatisfiedBy($this->cache)) {
         $userId = $this->guard->check() ? $this->guard->user()->getAuthIdentifier() : null;
         $duration = $this->config->get('sidebar.cache.duration');
         return $this->cache->tags(CacheKey::get($name))->remember(CacheKey::get($name, $userId), $duration, function () use($name) {
             return $this->resolver->resolve($name);
         });
     }
 }
コード例 #3
0
 /**
  * Flush
  *
  * @param $name
  */
 public function flush($name)
 {
     $this->cache->forget(CacheKey::get($name));
 }