Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
276e68d
Add Redis MultiExec trait
binaryfire Dec 12, 2025
fbe8634
Add new helpers to RedisConnection and update docblock
binaryfire Dec 12, 2025
4f0d09e
Add Redis package tests
binaryfire Dec 12, 2025
f4e28a3
Add Redis package tests
binaryfire Dec 12, 2025
baedd33
Add Redis package tests
binaryfire Dec 12, 2025
381cf77
Update Redis facade docblock with new methods
binaryfire Dec 12, 2025
3fa92da
Redis driver: flush by pattern
binaryfire Dec 12, 2025
3642f9a
Redis driver: non-tagged operations classes
binaryfire Dec 12, 2025
e2c5a7d
Redis driver: 'all' tag mode operations classes
binaryfire Dec 12, 2025
f91ea3e
Redis driver: 'any' tag mode operations classes
binaryfire Dec 12, 2025
35c7720
Redis driver: SafeScan for prefix-friendly performing scans
binaryfire Dec 12, 2025
9e8b1ff
Redis driver: fix directory structure
binaryfire Dec 12, 2025
7d0b5a1
Redis driver: separate tagged cache + tag set classes per tag mode
binaryfire Dec 12, 2025
4f2a4b2
Redis driver: TagMode enum
binaryfire Dec 12, 2025
1fb663d
Redis driver: prune stale tags command for cleanup in both tag modes
binaryfire Dec 12, 2025
8f5c5b4
Redis driver: prune stale tags command for cleanup in both tag modes
binaryfire Dec 12, 2025
6fff416
Redis driver: benchmark command
binaryfire Dec 12, 2025
a3b2851
Redis driver: benchmark command
binaryfire Dec 12, 2025
461077a
Redis driver: store detection trait for commands
binaryfire Dec 12, 2025
8212419
Redis driver: doctor command for friendly debugging of issues
binaryfire Dec 12, 2025
cc696ce
Redis driver: doctor command for friendly debugging of issues
binaryfire Dec 12, 2025
af234aa
Redis driver: serialization and store context support classes
binaryfire Dec 12, 2025
bd28db9
Redis driver: inline lock Lua script and delete LuaScripts to keep st…
binaryfire Dec 12, 2025
691036e
Add .tmp dir for storage of temporary files during development
binaryfire Dec 12, 2025
ff1849e
Redis driver: merge new components package changes
binaryfire Dec 12, 2025
e517a34
Redis driver: merge new components package changes
binaryfire Dec 12, 2025
08b2a30
Redis driver: merge new components package changes
binaryfire Dec 12, 2025
f93d065
Redis driver: merge new components package changes
binaryfire Dec 12, 2025
7d7d7fd
Redis driver: merge new components package changes
binaryfire Dec 12, 2025
c09f40f
Redis driver: add monitoring and system info support classes
binaryfire Dec 12, 2025
97dbb67
Redis driver: merge new driver tests
binaryfire Dec 12, 2025
0a362c2
Redis driver: merge new driver tests
binaryfire Dec 12, 2025
88ff8d4
Redis driver: merge new driver tests
binaryfire Dec 12, 2025
dbced16
Redis driver: merge new driver tests
binaryfire Dec 12, 2025
b4472e8
Redis driver: add exception classes
binaryfire Dec 12, 2025
f272e80
Remove unnecessary client method from RedisConnection
binaryfire Dec 12, 2025
f61dd5c
Redis driver: fix phpstan errors
binaryfire Dec 12, 2025
bfa3cc0
Redis driver: fix phpstan errors
binaryfire Dec 12, 2025
adca807
Redis driver: fix phpstan errors
binaryfire Dec 12, 2025
6aa9b14
Redis driver: fix phpstan errors
binaryfire Dec 12, 2025
98f7984
Add .env support for tests and set up for integration tests
binaryfire Dec 12, 2025
e0d0df8
Redis integration testing
binaryfire Dec 12, 2025
d49d38a
Redis integration testing
binaryfire Dec 12, 2025
989b1ad
Fix code style and phpstan
binaryfire Dec 12, 2025
833e06c
Switch Redis integration tests to Swoole 6.1.4 image for PhpRedis 6.3.0
binaryfire Dec 12, 2025
e14de46
Fix tests
binaryfire Dec 12, 2025
cbe5452
Fix composer class name warnings, add package caching to CI
binaryfire Dec 12, 2025
ac8d3ff
Redis cache: integration tests wip
binaryfire Dec 12, 2025
af5b175
Redis cache: integration tests wip
binaryfire Dec 12, 2025
67bfbbc
Redis cache: integration tests wip
binaryfire Dec 12, 2025
cee5ae6
Redis cache: integration tests wip
binaryfire Dec 12, 2025
5d41d1d
Redis cache: integration tests wip
binaryfire Dec 12, 2025
1b1fd4d
Redis cache: integration tests wip
binaryfire Dec 12, 2025
e9140bc
Redis cache: integration tests wip
binaryfire Dec 12, 2025
5e761b5
Redis cache: integration tests wip
binaryfire Dec 12, 2025
b300ce4
Redis cache: integration tests wip
binaryfire Dec 12, 2025
2f4a1ef
Redis cache: tests
binaryfire Dec 12, 2025
1034aad
Fix phpstan and code style
binaryfire Dec 12, 2025
4ff4e57
Paratest for integration tests wip
binaryfire Dec 12, 2025
959544f
Redis cache: reorganise support classes
binaryfire Dec 13, 2025
985d94c
Redis cache: update config file
binaryfire Dec 13, 2025
04bf635
Update prune tags command signature
binaryfire Dec 13, 2025
374db66
Merge remote-tracking branch 'origin/main' into redis-cache-driver
binaryfire Dec 24, 2025
6fba10f
Merge remote-tracking branch 'origin/main' into redis-cache-driver
binaryfire Dec 27, 2025
ce31548
Fix PHPStan level 5 errors in cache package
binaryfire Dec 27, 2025
ecc1f8d
Add phpstan-ignore for known Redis exception bug
binaryfire Dec 27, 2025
4f5e1c1
Fix GetTaggedKeys HSCAN iterator initialization
binaryfire Dec 27, 2025
771060a
Add CollectedBy attribute
binaryfire Dec 31, 2025
96eb890
Add @group integration to all integration tests for unified exclusion
binaryfire Jan 1, 2026
7d4fadd
Merge remote-tracking branch 'origin/main' into feature/collected-by-…
binaryfire Jan 7, 2026
9059ed7
Add $collectionClass property support for custom collections
binaryfire Jan 7, 2026
61b4a91
Add HasCollection support to Pivot and MorphPivot
binaryfire Jan 7, 2026
fa87a70
Merge branch 'main' into redis-cache-driver
binaryfire Jan 7, 2026
5134da7
Restore LuaScripts class and revert RedisLock to use it
binaryfire Jan 7, 2026
9ec5ac8
Extract Lua scripts to dedicated methods with ARGV documentation
binaryfire Jan 7, 2026
de49cfd
Update .env example
binaryfire Jan 8, 2026
16b886b
chore: add types analysis to CI workflow
storyn26383 Jan 15, 2026
c797914
feat(testing): add testbench-style testing infrastructure (phases 1-4.2)
binaryfire Jan 16, 2026
7e42a9f
feat(testing): add InteractsWithTestCase trait
binaryfire Jan 16, 2026
9edebb2
feat(testing): add TestingFeature orchestrator
binaryfire Jan 16, 2026
5a41b4b
feat(testing): add testing attributes
binaryfire Jan 16, 2026
fbd99ee
feat(testbench): add package provider, route, and database traits
binaryfire Jan 16, 2026
c0b27a5
feat(testbench): integrate traits and attributes into TestCase
binaryfire Jan 16, 2026
7442f0a
test(foundation): add AttributesTest for testing attributes
binaryfire Jan 16, 2026
d1bd785
test(foundation): add HandlesAttributesTest
binaryfire Jan 16, 2026
87b8d6d
test(foundation): add InteractsWithTestCaseTest
binaryfire Jan 16, 2026
89be1bb
test(testbench): add CreatesApplicationTest
binaryfire Jan 16, 2026
8c975e5
test(testbench): add HandlesRoutesTest
binaryfire Jan 16, 2026
682f152
test(testbench): add TestCaseTest
binaryfire Jan 16, 2026
9163bb8
fix(testing): fix return types and attribute execution in testing inf…
binaryfire Jan 16, 2026
406d743
style: apply php-cs-fixer formatting
binaryfire Jan 16, 2026
9d96389
feat(testbench): integrate route registration into TestCase lifecycle
binaryfire Jan 16, 2026
15c8dfd
style: apply php-cs-fixer formatting to testbench routes
binaryfire Jan 16, 2026
e91a8da
test(testing): add tests for Define meta-attribute and attribute inhe…
binaryfire Jan 16, 2026
78f73d3
refactor(testing): add ApplicationContract and Router type hints
binaryfire Jan 16, 2026
ff59427
Add withConnection() method for coroutine-safe pinned connections
binaryfire Jan 17, 2026
e9779ba
Refactor flushByPattern() to use withConnection()
binaryfire Jan 17, 2026
f4d789a
Add transform parameter to Redis::withConnection() for raw phpredis s…
binaryfire Jan 17, 2026
eeebf22
Consolidate Redis cache test infrastructure into RedisCacheTestCase
binaryfire Jan 17, 2026
21bf5a0
Add evalWithShaCache method to RedisConnection for robust Lua script …
binaryfire Jan 17, 2026
9cb1f75
Clear stale errors before evalSha in evalWithShaCache
binaryfire Jan 17, 2026
c8b7ec1
Remove unnecessary client() indirection from Redis operations
binaryfire Jan 17, 2026
b6663c2
Fix RedisConnection @method annotations
binaryfire Jan 17, 2026
35d380f
Add missing Laravel validation rules: Contains, DoesntContain, dateTime
binaryfire Jan 18, 2026
d27ef93
Merge remote-tracking branch 'origin/main' into redis-cache-driver
binaryfire Jan 19, 2026
6447eb1
Merge pull request #343 from hypervel/feature/workflows
albertcht Jan 23, 2026
2ea79d8
Merge branch 'main' into feature/collected-by-attribute
albertcht Jan 24, 2026
eb92fac
chore: fix phpstan errors
albertcht Jan 24, 2026
9d5eb09
chore: remove redundant phpdocs
albertcht Jan 24, 2026
64018e8
Merge pull request #345 from binaryfire/port-missing-validation-rules
albertcht Jan 24, 2026
6927f45
Merge pull request #331 from binaryfire/feature/collected-by-attribute
albertcht Jan 26, 2026
7861a6e
chore: fix phpstan errors
bluehaha Jan 26, 2026
39aa2fe
Merge pull request #350 from bluehaha/feature/fix-phpstan
albertcht Jan 26, 2026
d3320f8
Merge branch 'main' into redis-cache-driver
binaryfire Jan 26, 2026
835a5ba
refactor: rename $ctx to $context in benchmark and doctor commands
binaryfire Jan 26, 2026
7459371
Merge branch 'main' into feat/testbench-testing-features
binaryfire Jan 26, 2026
8d6fafb
fix: address PR review feedback for testing attributes
binaryfire Jan 26, 2026
e1c086f
chore: remove unused TestingFeature class
binaryfire Jan 26, 2026
8490d83
chore: avoid using abbreviated variables
albertcht Jan 26, 2026
05e2f16
Merge branch 'redis-cache-driver' of github.com:binaryfire/hypervel-c…
albertcht Jan 26, 2026
25e27eb
Merge pull request #344 from binaryfire/feat/testbench-testing-features
albertcht Jan 26, 2026
59b9a9d
Merge remote-tracking branch 'origin/main' into redis-cache-driver
binaryfire Jan 26, 2026
7f69ce1
refactor: simplify enum_value() helper function
binaryfire Jan 26, 2026
f3ffec6
feat: add UnitEnum support to Collection
binaryfire Jan 26, 2026
d90fe65
feat: add countBy with UnitEnum support to LazyCollection
binaryfire Jan 26, 2026
90c4d63
feat: add UnitEnum support to Js class
binaryfire Jan 26, 2026
680ef0e
feat: add UnitEnum support for timezone in InteractsWithData::date()
binaryfire Jan 26, 2026
0c0c58f
feat: add UnitEnum support to Facades
binaryfire Jan 26, 2026
fbe8b9a
feat: add UnitEnum support to session package
binaryfire Jan 26, 2026
393cfb8
feat(cache): add UnitEnum support to cache package
binaryfire Jan 26, 2026
3596d98
feat(cache): add UnitEnum support to Redis tagged cache
binaryfire Jan 26, 2026
bbe13b4
feat(core): add UnitEnum support to Context class
binaryfire Jan 26, 2026
71f1d60
feat(core): add UnitEnum support to Eloquent components
binaryfire Jan 26, 2026
4d183ef
feat(core): add UnitEnum support to Query Builder
binaryfire Jan 26, 2026
13d2202
feat: add UnitEnum support to auth, broadcasting, and bus packages
binaryfire Jan 26, 2026
104f43b
feat: add UnitEnum support to console and cookie packages
binaryfire Jan 26, 2026
9248a9f
feat: add UnitEnum support to event and filesystem packages
binaryfire Jan 26, 2026
6e3f1f3
feat(foundation): add UnitEnum support
binaryfire Jan 26, 2026
cc99244
refactor(permission): simplify type hints to UnitEnum
binaryfire Jan 26, 2026
c49a82a
refactor(queue): simplify RateLimited type hint to UnitEnum
binaryfire Jan 26, 2026
9059da3
feat(redis): add UnitEnum support to connection() method
binaryfire Jan 26, 2026
954a7e2
test: add enum support test files from 0.4 branch
binaryfire Jan 26, 2026
9c42e09
feat: add UnitEnum support to router, sanctum, and translation packages
binaryfire Jan 26, 2026
943ec65
feat: add UnitEnum support to validation and horizon packages
binaryfire Jan 26, 2026
1b266bc
revert: keep original ProcessInspector docblock annotation
binaryfire Jan 26, 2026
5681f9c
fix: add phpstan-ignore for HasCollection generic type errors
binaryfire Jan 26, 2026
a7f1b26
fix: use artisan instead of bin/hyperf.php in benchmark command messages
binaryfire Jan 26, 2026
4c4e612
feat: add Prohibitable trait to benchmark and doctor commands
binaryfire Jan 26, 2026
45e12bd
Merge branch '0.4' (enum support manually ported)
binaryfire Jan 26, 2026
f5f2889
feat: add InteractsWithRedis trait with auto-skip for Redis integrati…
binaryfire Jan 27, 2026
291f788
fix: use swoole 6.1.4 container for Redis integration tests
binaryfire Jan 27, 2026
e56ddaa
Update .env example
binaryfire Jan 27, 2026
05fe0f7
fix: update redis workflow and cache config
binaryfire Jan 27, 2026
71bb490
feat: add Redis/MySQL services to tests.yml and auto-skip any-mode tests
binaryfire Jan 27, 2026
38f7c09
fix: add MySQL config and improve any tag mode skip caching
binaryfire Jan 27, 2026
afa6b59
revert: remove Redis/MySQL services from tests.yml for now
binaryfire Jan 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Integration tests environment example
# Copy this file to .env and configure to run integration tests locally.
#
# ## Database Configuration##
# Set DB_CONNECTION to the database you want to test against.
# Tests in tests/Integration/Database will run against this connection.
#
# ## Redis Configuration ##
# Integration tests auto-skip if Redis is unavailable on default host/port.
# Set REDIS_HOST to run tests against a specific Redis instance.
# If REDIS_HOST is set explicitly, tests will fail (not skip) if Redis is unavailable.

# Database
# DB_CONNECTION=mysql
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=testing
# DB_USERNAME=root
# DB_PASSWORD=password

# Redis
# REDIS_HOST=127.0.0.1
# REDIS_PORT=6379
# REDIS_AUTH=
# REDIS_DB=8
98 changes: 98 additions & 0 deletions .github/workflows/redis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: redis

on:
push:
pull_request:

jobs:
redis_8:
runs-on: ubuntu-latest
timeout-minutes: 10

services:
redis:
image: redis:8
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5

container:
image: phpswoole/swoole:6.1.4-php8.4

strategy:
fail-fast: true

name: Redis 8

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: /root/.composer/cache
key: composer-8.4-${{ hashFiles('composer.lock') }}
restore-keys: composer-8.4-

- name: Install dependencies
run: COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist -n -o

- name: Execute Redis integration tests
env:
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_DB: 8
run: |
vendor/bin/phpunit tests/Integration/Cache/Redis
vendor/bin/phpunit tests/Redis/Integration

valkey_9:
runs-on: ubuntu-latest
timeout-minutes: 10

services:
valkey:
image: valkey/valkey:9
ports:
- 6379:6379
options: >-
--health-cmd "valkey-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5

container:
image: phpswoole/swoole:6.1.4-php8.4

strategy:
fail-fast: true

name: Valkey 9

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: /root/.composer/cache
key: composer-8.4-${{ hashFiles('composer.lock') }}
restore-keys: composer-8.4-

- name: Install dependencies
run: COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist -n -o

- name: Execute Redis integration tests
env:
REDIS_HOST: valkey
REDIS_PORT: 6379
REDIS_DB: 8
run: |
vendor/bin/phpunit tests/Integration/Cache/Redis
vendor/bin/phpunit tests/Redis/Integration
4 changes: 3 additions & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ jobs:
COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist -n -o

- name: Execute static analysis
run: vendor/bin/phpstan --configuration="phpstan.neon.dist" --memory-limit=-1
run: |
vendor/bin/phpstan --configuration="phpstan.neon.dist" --memory-limit=-1
vendor/bin/phpstan --configuration="phpstan.types.neon.dist" --memory-limit=-1
7 changes: 7 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: /root/.composer/cache
key: composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }}
restore-keys: composer-${{ matrix.php }}-

- name: Install dependencies
run: |
COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist -n -o
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.idea
/.env
/.phpunit.cache
/.tmp
/vendor
composer.lock
/phpunit.xml
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
bootstrap="tests/bootstrap.php"
beStrictAboutTestsThatDoNotTestAnything="false"
colors="true"
processIsolation="false"
Expand Down
9 changes: 5 additions & 4 deletions src/cache/publish/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'tag_mode' => env('REDIS_CACHE_TAG_MODE', 'all'), // Redis 8.0+ and PhpRedis 6.3.0+ required for 'any'
'lock_connection' => 'default',
],

Expand Down Expand Up @@ -101,11 +102,11 @@
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
| When utilizing the database or Redis cache stores, there might be other
| applications using the same cache. For that reason, you may prefix
| every cache key to avoid collisions.
|
*/

'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'hyperf'), '_') . '_cache'),
'prefix' => env('CACHE_PREFIX', Str::slug((string) env('APP_NAME', 'hypervel')) . '-cache-'),
];
1 change: 1 addition & 0 deletions src/cache/src/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ protected function createRedisDriver(array $config): Repository
$connection = $config['connection'] ?? 'default';

$store = new RedisStore($redis, $this->getPrefix($config), $connection);
$store->setTagMode($config['tag_mode'] ?? 'all');

return $this->repository(
$store->setLockConnection($config['lock_connection'] ?? $connection),
Expand Down
6 changes: 6 additions & 0 deletions src/cache/src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Hypervel\Cache\Contracts\Store;
use Hypervel\Cache\Listeners\CreateSwooleTable;
use Hypervel\Cache\Listeners\CreateTimer;
use Hypervel\Cache\Redis\Console\BenchmarkCommand;
use Hypervel\Cache\Redis\Console\DoctorCommand;
use Hypervel\Cache\Redis\Console\PruneStaleTagsCommand;

class ConfigProvider
{
Expand All @@ -25,8 +28,11 @@ public function __invoke(): array
CreateTimer::class,
],
'commands' => [
BenchmarkCommand::class,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @binaryfire , should we avoid requiring this command in production environment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@albertcht In the Laravel version I used Prohibitable and left it up to the user. I think that might be better, because advanced users may want to benchmark production setups from time to time. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think adding Prohibitable trait is better. It can prevent users executing this command unexpectedly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@binaryfire , I think we can also add Prohibitable to the doctor command?

Copy link
Contributor Author

@binaryfire binaryfire Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@albertcht Sure, I'll do it. The doctor command is lightweight and uses prefixed keys to avoid collisions. It's designed for detecting issues in production. But there's no harm in having Prohibitable on it as well. Then users can decide.

ClearCommand::class,
DoctorCommand::class,
PruneDbExpiredCommand::class,
PruneStaleTagsCommand::class,
],
'publish' => [
[
Expand Down
76 changes: 76 additions & 0 deletions src/cache/src/Redis/AllTagSet.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php

declare(strict_types=1);

namespace Hypervel\Cache\Redis;

use Hyperf\Collection\LazyCollection;
use Hypervel\Cache\Contracts\Store;
use Hypervel\Cache\RedisStore;
use Hypervel\Cache\TagSet;

class AllTagSet extends TagSet
{
/**
* The cache store implementation.
*
* @var RedisStore
*/
protected Store $store;

/**
* Add a reference entry to the tag set's underlying sorted set.
*/
public function addEntry(string $key, int $ttl = 0, ?string $updateWhen = null): void
{
$this->store->allTagOps()->addEntry()->execute($key, $ttl, $this->tagIds(), $updateWhen);
}

/**
* Get all of the cache entry keys for the tag set.
*/
public function entries(): LazyCollection
{
return $this->store->allTagOps()->getEntries()->execute($this->tagIds());
}

/**
* Flush the tag from the cache.
*/
public function flushTag(string $name): string
{
return $this->resetTag($name);
}

/**
* Reset the tag and return the new tag identifier.
*/
public function resetTag(string $name): string
{
$this->store->forget($this->tagKey($name));

return $this->tagId($name);
}

/**
* Get the unique tag identifier for a given tag.
*
* Delegates to StoreContext which delegates to TagMode (single source of truth).
* Format: "_all:tag:{name}:entries"
*/
public function tagId(string $name): string
{
return $this->store->getContext()->tagId($name);
}

/**
* Get the tag identifier key for a given tag.
*
* Same as tagId() - the identifier without cache prefix.
* Used with store->forget() which adds the prefix.
*/
public function tagKey(string $name): string
{
return $this->store->getContext()->tagId($name);
}
}
Loading