/**
  * {@inheritdoc}
  */
 protected function clearOneObjectFromCache($key)
 {
     if (null === $this->store->get($key)) {
         return true;
     }
     return $this->store->forget($key);
 }
示例#2
0
 /**
  * Clear the cache for the given user.
  *
  * @param  \Illuminate\Database\Eloquent\Model|int  $user
  * @return $this
  */
 public function refreshFor($user)
 {
     $id = $user instanceof Model ? $user->getKey() : $user;
     $this->cache->forget($this->tag . '-permissions-' . $id);
     $this->cache->forget($this->tag . '-roles-' . $id);
     return $this;
 }
示例#3
0
 /**
  * Clear the cache for the given authority.
  *
  * @param  \Illuminate\Database\Eloquent\Model  $authority
  * @return $this
  */
 public function refreshFor(Model $authority)
 {
     $this->cache->forget($this->getCacheKey($authority, 'abilities', true));
     $this->cache->forget($this->getCacheKey($authority, 'abilities', false));
     $this->cache->forget($this->getCacheKey($authority, 'roles'));
     return $this;
 }
示例#4
0
 /**
  * Clear the cache for the given user.
  *
  * @param  \Illuminate\Database\Eloquent\Model  $user
  * @return $this
  */
 public function refreshFor(Model $user)
 {
     $id = $user->getKey();
     $this->cache->forget($this->tag . '-abilities-' . $id);
     $this->cache->forget($this->tag . '-roles-' . $id);
     return $this;
 }
示例#5
0
 /**
  * {@inheritdoc}
  */
 public function delete($key)
 {
     if ($this->cache->forget($key) === false) {
         return false;
     }
 }
示例#6
0
 /**
  * Remove an item from the cache.
  *
  * @param  string  $key
  * @return bool
  */
 public function forget($key)
 {
     return $this->store->forget($this->taggedItemKey($key));
 }
 /**
  * Remove an item from the cache.
  *
  * @param  string $key
  * @return bool
  */
 public function forget($key)
 {
     $success = $this->store->forget($key);
     $this->fireCacheEvent('delete', [$key]);
     return $success;
 }
 /**
  * Remove an item from the cache.
  *
  * @param  string $key
  *
  * @return bool
  */
 public function forget($key)
 {
     return $this->store->forget($key);
 }
示例#9
0
 /**
  * Clear the login locks for the given user credentials.
  * @param  Request  $request
  * @return void
  */
 protected function clearLoginAttempts(Request $request, Cache $cache)
 {
     $cache->forget($this->loginAttemptsKey($request));
     $cache->forget($this->loginLockExpirationKey($request));
 }