LaravelPackages.net
Acme Inc.
Toggle sidebar
guillermobt/laravel-redis-fallback

Laravel 5 redis cache fallback to file

141
0
1.2.3
About guillermobt/laravel-redis-fallback

guillermobt/laravel-redis-fallback is a Laravel package for laravel 5 redis cache fallback to file. It currently has 0 GitHub stars and 141 downloads on Packagist (latest version 1.2.3). Install it with composer require guillermobt/laravel-redis-fallback. Discover more Laravel packages by guillermobt or browse all Laravel packages to compare alternatives.

Last updated

Note about this fork

This is forked from xtcat/laravel-redis-fallback to fix an issue with Laravel versions 5.0 to 5.3 related to the lost functionality of the command: php artisan cache:clear

Xtcat will be creating a new branch to solve it.

Redis cache fallback for Laravel 5

If you use Redis as cache driver on Laravel 5 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 to use

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

"guillermobt/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',
	...
	\guillermobt\LaravelRedisFallback\LaravelRedisFallbackServiceProvider::class
	...
)

Events

You can listen to 'redis.unavailable' event in your listener, for example send an email to you when the redis server is down.

Enjoy!

Comments