PHPackages                             partechgss/laravel-multi-cache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. partechgss/laravel-multi-cache

ActiveLibrary[Caching](/categories/caching)

partechgss/laravel-multi-cache
==============================

Combine multiple caches in Laravel 6.

2.0.0(4y ago)0664MITPHPPHP &gt;=7.4

Since Feb 25Pushed 4y agoCompare

[ Source](https://github.com/PartechGSS/laravel-multi-cache)[ Packagist](https://packagist.org/packages/partechgss/laravel-multi-cache)[ RSS](/packages/partechgss-laravel-multi-cache/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

Laravel Multi Cache
===================

[](#laravel-multi-cache)

Allows you to use multiple Laravel cache stores as one. Retrieves items from the first cache they are found in.

An example use is to have an array cache and Redis cache. Fetch items from the array cache first (faster), and from Redis if the key was not found. The value will be stored in the array cache if it was found in Redis.

Installation
------------

[](#installation)

```
composer require partechgss/laravel-multi-cache

```

Add this to your config/app.php `providers` array:

```
Partechgss\LaravelMultiCache\MultiStoreServiceProvider::class
```

Add the `multi` store to your `config/cache.php` `stores` array:

```
    'stores' => [
        'array' => [
            'driver' => 'array',
        ],
        'database' => [
            'driver' => 'database',
            'table'  => 'cache',
            'connection' => null,
        ],
        'redis' => [
            'driver' => 'redis',
            'connection' => 'redis-cache',
        ],
        'multi' => [
            'driver' => 'multi',
            'stores' => [
                'array',
                'redis',
                'database'
            ]
        ]
    ],

```

Set your `CACHE_DRIVER` in `.env`:

```
CACHE_DRIVER=multi

```

Usage
-----

[](#usage)

The cache implements the standard cache interface, so you use all the normal `get()` and `put()` methods.

### `get($key)`

[](#getkey)

Returns the value from the first store `$key` is found in (in the order defined in `stores`). The value will be saved in any higher 'stores'. e.g. If the value is not found it `array`, but is in `redis`, the value from `redis` will be returned and put in `array`, but it will not be put in `database`.

### `put($key, $value, $minutes)`

[](#putkey-value-minutes)

Stores an item in all of the stores.

All of the other methods (`increment()`, `forget()`, `flush()`, etc.) perform the operation on all of the stores.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1707 days

Total

2

Last Release

1652d ago

Major Versions

1.0.0 → 2.0.02021-10-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb95379117accde4bde43e07d00e1b537925cdb76dca9f48b7db76d4eb65ef51?d=identicon)[drprice](/maintainers/drprice)

---

Top Contributors

[![antriver](https://avatars.githubusercontent.com/u/251159?v=4)](https://github.com/antriver "antriver (6 commits)")[![derekrprice](https://avatars.githubusercontent.com/u/5413632?v=4)](https://github.com/derekrprice "derekrprice (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/partechgss-laravel-multi-cache/health.svg)

```
[![Health](https://phpackages.com/badges/partechgss-laravel-multi-cache/health.svg)](https://phpackages.com/packages/partechgss-laravel-multi-cache)
```

###  Alternatives

[swayok/alternative-laravel-cache

Replacements for Laravel's redis and file cache stores that properly implement tagging idea. Powered by cache pool implementations provided by http://www.php-cache.com/

202541.1k6](/packages/swayok-alternative-laravel-cache)[byerikas/cache-tags

Allows for Redis/Valkey cache flushing multiple tagged items by a single tag.

1413.9k](/packages/byerikas-cache-tags)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
