lukaszaleckas/laravel-fallback-cache

There is no license information available for the latest version (v1.0.0) of this package.

v1.0.0 2023-03-24 13:52 UTC

This package is auto-updated.

Last update: 2024-12-05 08:08:53 UTC


README

This simple package aims to handle cache store downtimes.

Let's say your default cache driver is redis and you experience it's downtime. Your whole app would be down because of that.

This package tries retrieving a value from cache store and if exception is thrown, switches cache driver / store to a one specified in config.

Installation

  1. Run:
composer require lukaszaleckas/laravel-fallback-cache

This package does not automatically register service provider, since you might be using cache in other providers. So you need to register it in your application's app.php:

LaravelFallbackCache\FallbackCacheServiceProvider::class

Note: if you are using cache in other providers, register this one before them.

  1. Publish fallback-cache.php config file:
    php artisan vendor:publish --tag=fallback-cache

That's it!