tenantcloud / laravel-better-cache
Improvements for Laravel's cache
Installs: 21 815
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=8.2
- illuminate/cache: ^10.0|^11.0
- illuminate/contracts: ^10.0|^11.0
Requires (Dev)
- nunomaduro/larastan: ^2.6
- orchestra/testbench: ^8.5|^9.0
- pestphp/pest: ^2.8
- php-cs-fixer/shim: ^3.54
- phpstan/phpstan: ~1.10.21
- phpstan/phpstan-mockery: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- phpstan/phpstan-webmozart-assert: ^1.2
- predis/predis: ^2.0
- tenantcloud/php-cs-fixer-rule-sets: ~3.3.1
- timacdonald/log-fake: ^2.0
This package is auto-updated.
Last update: 2025-06-18 12:23:06 UTC
README
Fail safe
Laravel's implementation of cache doesn't allow failures - if your Redis dies, your app dies too.
New fail_safe
driver aims to solve this by catching and logging all exceptions and instead
returning null/false as if the value was simply not found in cache:
// config/cache.php [ 'fail_safe' => [ 'delegate' => [ 'driver' => 'redis', 'connection' => 'cache', 'lock_connection' => 'default', ] ] ] // code Cache::forever('key', 'value'); // redis died here Cache::get('key'); // returns null and logs the exception