Silber\Bouncer\CachedClipboard::setCache PHP Method

setCache() public method

Set the cache instance.
public setCache ( Illuminate\Contracts\Cache\Store $cache )
$cache Illuminate\Contracts\Cache\Store
    public function setCache(Store $cache)
    {
        if (method_exists($cache, 'tags')) {
            $cache = $cache->tags($this->tag);
        }
        $this->cache = $cache;
        return $this;
    }

Usage Example

Example #1
0
 /**
  * Use the given cache instance.
  *
  * @param  \Illuminate\Contracts\Cache\Store  $cache
  * @return $this
  */
 public function cache(Store $cache = null)
 {
     $cache = $cache ?: $this->make(CacheRepository::class)->getStore();
     $this->clipboard->setCache($cache);
     return $this;
 }
All Usage Examples Of Silber\Bouncer\CachedClipboard::setCache