PHPackages                             davidepedone/laravel-redis-fallback - 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. davidepedone/laravel-redis-fallback

ActiveLibrary[Caching](/categories/caching)

davidepedone/laravel-redis-fallback
===================================

Laravel 4 redis cache fallback to file

v1.0.1(11y ago)41416MITPHPPHP &gt;=5.4.0

Since Mar 23Pushed 11y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (3)Used By (0)

Redis cache fallback for Laravel4
=================================

[](#redis-cache-fallback-for-laravel4)

If you use Redis as cache driver on Laravel 4 and for some reason Redis server became unavailable, you will end up with a Connection Refused exception. This package simply checks for the connection and if test fails, cache is switched to file driver. As soon as Redis come back it will be used again.

\##How it works `LaravelRedisFallbackServiceProvider` class extends `Illuminate\Cache\CacheServiceProvider` and overrides `register()` method as follow:

```
	public function register(){

		$this->app->bindShared('cache', function($app){
			return new \Davidepedone\LaravelRedisFallback\LaravelRedisFallback($app);
		});
		...
	}
```

`LaravelRedisFallback` class extends `Illuminate\Cache\CacheManager` and overrides `createRedisDriver()` method as follow:

```
    protected function createRedisDriver() {

        $redis = $this->app['redis'];
        $redisStore = new RedisStore($redis, $this->getPrefix());

        try{

            $redisStore->getRedis()->ping();
            return $this->repository( $redisStore );

        }catch(\Exception $e){

            return parent::createFileDriver();
        }

    }
```

\##How to use Install LaravelRedisFallback as a Composer package, adding this line to your composer.json:

```
"davidepedone/laravel-redis-fallback": "dev-master"
```

and update your vendor folder running the `composer update ` command.

Replace the default cache service provider:

```
'providers' => array(
	...
	//'Illuminate\Cache\CacheServiceProvider',
	...
	'Davidepedone\LaravelRedisFallback\LaravelRedisFallbackServiceProvider'
	...
)
```

Enjoy!

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

4074d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/10d04ba8e780e53e23303e1243de9702d214f3dab68d5a0f132fe6eb4501d1b7?d=identicon)[davidepedone](/maintainers/davidepedone)

---

Top Contributors

[![davidepedone](https://avatars.githubusercontent.com/u/2741896?v=4)](https://github.com/davidepedone "davidepedone (4 commits)")

---

Tags

laravelrediscachefilelaravel4

### Embed Badge

![Health badge](/badges/davidepedone-laravel-redis-fallback/health.svg)

```
[![Health](https://phpackages.com/badges/davidepedone-laravel-redis-fallback/health.svg)](https://phpackages.com/packages/davidepedone-laravel-redis-fallback)
```

###  Alternatives

[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[vink/nova-cache-card

Manage your application's cache from a handy Laravel Nova dashboard card.

26317.3k1](/packages/vink-nova-cache-card)[dragon-code/laravel-cache

An improved interface for working with cache

6844.8k10](/packages/dragon-code-laravel-cache)[nexxai/laravel-cfcache

A handful of Cloudflare cache helpers for Laravel

1317.7k](/packages/nexxai-laravel-cfcache)

PHPackages © 2026

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