interface
Illuminate
/
Contracts
/
Cache
/
Repository
You are viewing an older version of the documentation. For the latest, please visit master documentation.
Repository
Methods
public
pull ( $key , $default ) : mixed
Retrieve an item from the cache and delete it.
Parameters
- $key string
- $default mixed
public
put ( $key , $value , $ttl ) : bool
Store an item in the cache.
Parameters
- $key string
- $value mixed
- $ttl DateTimeInterface |DateInterval |int|null
public
add ( $key , $value , $ttl ) : bool
Store an item in the cache if the key does not exist.
Parameters
- $key string
- $value mixed
- $ttl DateTimeInterface |DateInterval |int|null
public
increment ( $key , $value ) : int|bool
Increment the value of an item in the cache.
Parameters
- $key string
- $value mixed
public
decrement ( $key , $value ) : int|bool
Decrement the value of an item in the cache.
Parameters
- $key string
- $value mixed
public
forever ( $key , $value ) : bool
Store an item in the cache indefinitely.
Parameters
- $key string
- $value mixed
public
remember ( $key , $ttl , Closure $callback ) : mixed
Get an item from the cache, or execute the given Closure and store the result.
Parameters
- $key string
- $ttl DateTimeInterface |DateInterval |int|null
- $callback Closure
public
sear ( $key , Closure $callback ) : mixed
Get an item from the cache, or execute the given Closure and store the result forever.
Parameters
- $key string
- $callback Closure
public
rememberForever ( $key , Closure $callback ) : mixed
Get an item from the cache, or execute the given Closure and store the result forever.
Parameters
- $key string
- $callback Closure
public
forget ( $key ) : bool
Remove an item from the cache.
Parameters
- $key string