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

ActivePackage

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

Combine multiple caches in Laravel

2.1.0(5mo ago)351.6k↓41.4%1MITPHPPHP &gt;=8.2CI passing

Since Oct 15Pushed 3mo 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 1mo ago

READMEChangelog (3)Dependencies (6)Versions (5)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

48

—

FairBetter than 95% of packages

Maintenance77

Regular maintenance activity

Popularity33

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity55

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

Total

3

Last Release

165d 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 (11 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)")[![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

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11120.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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