Silber\Bouncer\Bouncer::cache PHP Méthode

cache() public méthode

Use the given cache instance.
public cache ( Illuminate\Contracts\Cache\Store $cache = null )
$cache Illuminate\Contracts\Cache\Store
    public function cache(Store $cache = null)
    {
        if (!$this->usesCachedClipboard()) {
            throw new RuntimeException('To use caching, you must use an instance of CachedClipboard.');
        }
        $cache = $cache ?: $this->resolve(CacheRepository::class)->getStore();
        $this->clipboard->setCache($cache);
        return $this;
    }

Usage Example

 /**
  * Use the given cache instance.
  *
  * @param \Illuminate\Contracts\Cache\Store $cache
  * @return $this 
  * @static 
  */
 public static function cache($cache = null)
 {
     return \Silber\Bouncer\Bouncer::cache($cache);
 }