interface
Illuminate
/
Contracts
/
Cache
/
Repository
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.
Repository
Methods
public
pull ( $key , $default ) : mixed
Retrieve an item from the cache and delete it.
Parameters
- $key array|string
- $default TCacheValue|callable
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 ) : TCacheValue
Get an item from the cache, or execute the given Closure and store the result.
Parameters
- $key string
- $ttl DateTimeInterface |DateInterval |Closure |int|null
-
$
Closure
TCacheValue $callback
public
sear ( $key , Closure $callback ) : TCacheValue
Get an item from the cache, or execute the given Closure and store the result forever.
Parameters
- $key string
-
$
Closure
TCacheValue $callback
public
rememberForever ( $key , Closure $callback ) : TCacheValue
Get an item from the cache, or execute the given Closure and store the result forever.
Parameters
- $key string
-
$
Closure
TCacheValue $callback
public
forget ( $key ) : bool
Remove an item from the cache.
Parameters
- $key string