DatabaseStore
class DatabaseStore implements Store
Traits
Properties
protected ConnectionInterface | $connection | The database connection instance. |
|
protected Encrypter | $encrypter | The encrypter instance. |
|
protected string | $table | The name of the cache table. |
|
protected string | $prefix | A string that should be prepended to keys. |
Methods
Store multiple items in the cache for a given number of minutes.
Create a new database store.
Retrieve an item from the cache by key.
Store an item 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.
Increment or decrement an item in the cache.
Get the current system time.
Store an item in the cache indefinitely.
Remove an item from the cache.
Remove all items from the cache.
Get the underlying database connection.
Get the encrypter instance.
Get the cache key prefix.
Details
in
RetrievesMultipleKeys at line 15
array
many(array $keys)
Retrieve multiple items from the cache by key.
Items not found in the cache will have a null value.
in
RetrievesMultipleKeys at line 33
void
putMany(array $values, float|int $minutes)
Store multiple items in the cache for a given number of minutes.
at line 53
void
__construct(ConnectionInterface $connection, Encrypter $encrypter, string $table, string $prefix = '')
Create a new database store.
at line 68
mixed
get(string|array $key)
Retrieve an item from the cache by key.
at line 103
void
put(string $key, mixed $value, float|int $minutes)
Store an item in the cache for a given number of minutes.
at line 128
int|bool
increment(string $key, mixed $value = 1)
Increment the value of an item in the cache.
at line 142
int|bool
decrement(string $key, mixed $value = 1)
Decrement the value of an item in the cache.
at line 157
protected int|bool
incrementOrDecrement(string $key, mixed $value, Closure $callback)
Increment or decrement an item in the cache.
at line 201
protected int
getTime()
Get the current system time.
at line 213
void
forever(string $key, mixed $value)
Store an item in the cache indefinitely.
at line 224
bool
forget(string $key)
Remove an item from the cache.
at line 236
bool
flush()
Remove all items from the cache.
at line 246
protected Builder
table()
Get a query builder for the cache table.
at line 256
ConnectionInterface
getConnection()
Get the underlying database connection.
at line 266
Encrypter
getEncrypter()
Get the encrypter instance.
at line 276
string
getPrefix()
Get the cache key prefix.