Skip to content

Issue with flushing redis tagged cache with custom connection #57120

@miskith

Description

@miskith

Laravel Version

12.30.1

PHP Version

8.4.12

Database Driver & Version

No response

Description

There is new issue with commit e64c8ae when it is now not possible to flush tagged cache if you provide your own Connection. I am using sentinel connection with namoshek/laravel-redis-sentinel . This is achievable by providing custom Connection class, but it will never match this condtion

$redisPrefix = match ($this->store->connection()::class) { PhpRedisConnection::class => $this->store->connection()->client()->getOption(\Redis::OPT_PREFIX), PredisConnection::class => $this->store->connection()->client()->getOptions()->prefix, };

Steps To Reproduce

Provide different Connection than PhpRedisConnection or PredisConnection (for example namoshek/laravel-redis-sentinel ) and try to flush tagged cache, for example
Cache::tags(['test'])->flush();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions