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

ActiveLibrary

antriver/laravel-multi-cache
============================

Combine multiple caches in Laravel

10.1.0(1y ago)724.1k—7.2%5[2 PRs](https://github.com/antriver/laravel-multi-cache/pulls)MITPHPPHP &gt;=8.1

Since Feb 25Pushed 1y ago2 watchersCompare

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

READMEChangelogDependencies (4)Versions (5)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 antriver/laravel-multi-cache

```

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

```
Antriver\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

44

—

FairBetter than 92% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 82.4% 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 ~1370 days

Total

3

Last Release

629d ago

Major Versions

1.0.0 → 10.0.02024-02-06

PHP version history (2 changes)10.0.0PHP &gt;=7.4

10.1.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/7dc40f9d37443cd47fc0079800c1ea6cee515b4efce4e0dfb942f15969a82a39?d=identicon)[antriver](/maintainers/antriver)

---

Top Contributors

[![antriver](https://avatars.githubusercontent.com/u/251159?v=4)](https://github.com/antriver "antriver (14 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)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.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)
