| Methods |
public
|
pull<TCacheValue>(
array|string $key,
TCacheValue|(Closure(): TCacheValue) $default = null,
): (TCacheValue is null ? mixed : TCacheValue)
Retrieve an item from the cache and delete it.
Retrieve an item from the cache and delete it.
|
#
|
public
|
put(string $key, mixed $value, DateTimeInterface|DateInterval|int|null $ttl = null): bool
Store an item in the cache.
Store an item in the cache.
|
#
|
public
|
add(string $key, mixed $value, DateTimeInterface|DateInterval|int|null $ttl = null): bool
Store an item in the cache if the key does not exist.
Store an item in the cache if the key does not exist.
|
#
|
public
|
increment(string $key, mixed $value = 1): int|bool
Increment the value of an item in the cache.
Increment the value of an item in the cache.
|
#
|
public
|
decrement(string $key, mixed $value = 1): int|bool
Decrement the value of an item in the cache.
Decrement the value of an item in the cache.
|
#
|
public
|
forever(string $key, mixed $value): bool
Store an item in the cache indefinitely.
Store an item in the cache indefinitely.
|
#
|
public
|
remember<TCacheValue>(
string $key,
DateTimeInterface|DateInterval|Closure|int|null $ttl,
Closure(): TCacheValue $callback,
): TCacheValue
Get an item from the cache, or execute the given Closure and store the result.
Get an item from the cache, or execute the given Closure and store the result.
|
#
|
public
|
sear<TCacheValue>(string $key, Closure(): TCacheValue $callback): TCacheValue
Get an item from the cache, or execute the given Closure and store the result forever.
Get an item from the cache, or execute the given Closure and store the result forever.
|
#
|
public
|
rememberForever<TCacheValue>(string $key, Closure(): TCacheValue $callback): TCacheValue
Get an item from the cache, or execute the given Closure and store the result forever.
Get an item from the cache, or execute the given Closure and store the result forever.
|
#
|
public
|
forget(string $key): bool
Remove an item from the cache.
Remove an item from the cache.
|
#
|
public
|
getStore(): Store
Get the cache store implementation.
Get the cache store implementation.
|
#
|