class CacheStorage implements StorageContract

Constants

private KEY_PREFIX

Prefix that keeps blacklist keys apart from other cache keys.

Properties

protected string $tag
protected bool $writesThroughTags

Whether writes go through the blacklist tag so it can be flushed.

protected bool $readsThroughTags

Whether reads and deletes go through the blacklist tag.

Methods

__construct(Repository $cache)

Create a new cache storage instance.

bool
add(string $key, mixed $value, int $minutes)

Add a new item into storage.

bool
forever(string $key, mixed $value)

Add a new item into storage forever.

mixed
get(string $key)

Get an item from storage.

bool
destroy(string $key)

Remove an item from storage.

bool
flush()

Remove all items associated with the tag.

writeCache()

Get the cache that blacklist writes go through.

readCache()

Get the cache that blacklist reads and deletes go through.

string
storageKey(string $key)

Get the cache key for a logical blacklist key.

Details

at line 37
__construct(Repository $cache)

Create a new cache storage instance.

Parameters

Repository $cache

at line 51
bool add(string $key, mixed $value, int $minutes)

Add a new item into storage.

Parameters

string $key
mixed $value
int $minutes

Return Value

bool

at line 59
bool forever(string $key, mixed $value)

Add a new item into storage forever.

Parameters

string $key
mixed $value

Return Value

bool

at line 67
mixed get(string $key)

Get an item from storage.

Parameters

string $key

Return Value

mixed

at line 75
bool destroy(string $key)

Remove an item from storage.

Parameters

string $key

Return Value

bool

at line 86
bool flush()

Remove all items associated with the tag.

Only a store with tag support can clear the blacklist without removing other cache entries, so on any other store the cache's tags() call throws.

Return Value

bool

at line 95
protected Repository writeCache()

Get the cache that blacklist writes go through.

Return Value

Repository

at line 104
protected Repository readCache()

Get the cache that blacklist reads and deletes go through.

Return Value

Repository

at line 113
protected string storageKey(string $key)

Get the cache key for a logical blacklist key.

Parameters

string $key

Return Value

string