Repository
class Repository implements Repository, ArrayAccess (View source)
Traits
Properties
static protected array | $macros | The registered string macros. | from Macroable |
protected Store | $store | The cache store implementation. | |
protected Dispatcher | $events | The event dispatcher implementation. | |
protected float|int | $default | The default number of minutes to store items. |
Methods
Dynamically handle calls to the class.
Handle dynamic calls into macros or pass missing methods to the store.
Fire an event for this cache instance.
Determine if an item exists in the cache.
Retrieve an item from the cache by key.
Retrieve multiple items from the cache by key.
Retrieve an item from the cache and delete it.
Store multiple items in the cache for a given number of minutes.
Increment the value of an item in the cache.
Decrement the value of an item in the cache.
Store an item in the cache indefinitely.
Get an item from the cache, or store the default value forever.
Remove an item from the cache.
Begin executing a new tags operation if the store supports it.
Format the key for a cache item.
Get the default cache time.
Set the default cache time in minutes.
Determine if a cached value exists.
Retrieve an item from the cache by key.
Store an item in the cache for the default time.
Remove an item from the cache.
Clone cache repository instance.
Details
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
at line 503
mixed
__call(string $method, array $parameters)
Handle dynamic calls into macros or pass missing methods to the store.
at line 59
void
setEventDispatcher(Dispatcher $events)
Set the event dispatcher instance.
at line 71
protected void
fireCacheEvent(string $event, array $payload)
Fire an event for this cache instance.
at line 111
bool
has(string $key)
Determine if an item exists in the cache.
at line 123
mixed
get(string $key, mixed $default = null)
Retrieve an item from the cache by key.
at line 150
array
many(array $keys)
Retrieve multiple items from the cache by key.
Items not found in the cache will have a null value.
at line 180
mixed
pull(string $key, mixed $default = null)
Retrieve an item from the cache and delete it.
at line 197
void
put(string $key, mixed $value, DateTime|float|int $minutes = null)
Store an item in the cache.
at line 219
void
putMany(array $values, float|int $minutes)
Store multiple items in the cache for a given number of minutes.
at line 240
bool
add(string $key, mixed $value, DateTime|float|int $minutes)
Store an item in the cache if the key does not exist.
at line 268
int|bool
increment(string $key, mixed $value = 1)
Increment the value of an item in the cache.
at line 280
int|bool
decrement(string $key, mixed $value = 1)
Decrement the value of an item in the cache.
at line 292
void
forever(string $key, mixed $value)
Store an item in the cache indefinitely.
at line 307
mixed
remember(string $key, DateTime|float|int $minutes, Closure $callback)
Get an item from the cache, or store the default value.
at line 328
mixed
sear(string $key, Closure $callback)
Get an item from the cache, or store the default value forever.
at line 340
mixed
rememberForever(string $key, Closure $callback)
Get an item from the cache, or store the default value forever.
at line 360
bool
forget(string $key)
Remove an item from the cache.
at line 377
TaggedCache
tags(array|mixed $names)
Begin executing a new tags operation if the store supports it.
at line 400
protected string
itemKey(string $key)
Format the key for a cache item.
at line 410
float|int
getDefaultCacheTime()
Get the default cache time.
at line 421
void
setDefaultCacheTime(float|int $minutes)
Set the default cache time in minutes.
at line 442
bool
offsetExists(string $key)
Determine if a cached value exists.
at line 453
mixed
offsetGet(string $key)
Retrieve an item from the cache by key.
at line 465
void
offsetSet(string $key, mixed $value)
Store an item in the cache for the default time.
at line 476
void
offsetUnset(string $key)
Remove an item from the cache.
at line 487
protected float|int|null
getMinutes(DateTime|float|int $duration)
Calculate the number of minutes with the given duration.
at line 517
void
__clone()
Clone cache repository instance.