motomedialab/laravel-redis-driver

A Laravel Redis driver override that enforces clearing of cache using prefixes, rather than a flush
2,518
Install
composer require motomedialab/laravel-redis-driver
Latest Version:2.1.1
License:MIT
Last Updated:Sep 18, 2026
Links: GitHub  ·  Packagist
Maintainer: chrispage1

Laravel Redis Cache Store Override

A simple package that overrides the default behavior when flushing the Laravel Redis cache store.

Why?

The default behaviour of Laravel's Redis driver when calling cache()->clear() while using the Redis cache driver is to call a flushdb command for the entire Redis database. This is not always desirable, especially when using a multi tenancy Redis instance.

This package overrides that behaviour by clearing only the keys that match the cache prefix, stopping a global flushdb command from being called.

Installation

Simply pull the package in using composer, as below and you're good to go!

composer require motomedialab/laravel-redis-driver

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

584,532,650 34,931
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

391,429,217 4,660