PHPackages                             rapidez/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. rapidez/laravel-multi-cache

ActivePackage[Caching](/categories/caching)

rapidez/laravel-multi-cache
===========================

Combine multiple caches in Laravel

2.2.0(2mo ago)359.6k↓64.5%11MITPHPPHP &gt;=8.2CI passing

Since Oct 15Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/rapidez/laravel-multi-cache)[ Packagist](https://packagist.org/packages/rapidez/laravel-multi-cache)[ RSS](/packages/rapidez-laravel-multi-cache/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (12)Versions (6)Used By (1)

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 rapidez/laravel-multi-cache

```

The service provider will autoload, if you have disabled this add this to your config/app.php `providers` array:

```
Rapidez\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'
            ],
            'sync_missed_stores' => true,
        ]
    ],

```

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`. This behaviour can be disabled by setting `sync_missed_stores => false` in config.

### `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

52

—

FairBetter than 96% of packages

Maintenance87

Actively maintained with recent releases

Popularity34

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~184 days

Total

4

Last Release

74d ago

Major Versions

1.0.0 → 2.0.02025-03-06

PHP version history (2 changes)1.0.0PHP &gt;=8.1

2.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/72222911?v=4)[Rapidez](/maintainers/rapidez)[@rapidez](https://github.com/rapidez)

---

Top Contributors

[![antriver](https://avatars.githubusercontent.com/u/251159?v=4)](https://github.com/antriver "antriver (14 commits)")[![indykoning](https://avatars.githubusercontent.com/u/15870933?v=4)](https://github.com/indykoning "indykoning (12 commits)")[![gabriel-vasile](https://avatars.githubusercontent.com/u/10602896?v=4)](https://github.com/gabriel-vasile "gabriel-vasile (2 commits)")[![dramamask](https://avatars.githubusercontent.com/u/16373074?v=4)](https://github.com/dramamask "dramamask (1 commits)")[![Jade-GG](https://avatars.githubusercontent.com/u/32514269?v=4)](https://github.com/Jade-GG "Jade-GG (1 commits)")[![royduin](https://avatars.githubusercontent.com/u/1703233?v=4)](https://github.com/royduin "royduin (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

### Embed Badge

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

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

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3416.9k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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