haydarsahin / cache-migration
The package helpful about migrate redis cache for seamless deploys
Requires
- php: >=7.1
- illuminate/support: ^5.5|^5.6|^5.7|^5.8|^6.0|^7.0|^8.0|^9.0|^10.0
Requires (Dev)
- orchestra/testbench: ^3.5|^3.6|^3.7|^3.8|^4.0|^5.0|^6.0|^7.0|^8.0
- phpunit/phpunit: ~6.0|^7.0|^7.5|^8.4|^9.0
This package is auto-updated.
Last update: 2025-05-29 01:48:08 UTC
README
The package is developed for make seamless deploys. You can delete your cache by adding the desired redis keys to the migration file.
Requirement
- Laravel >= 5.x
- PHP >= 7.1
Installation
Install via composer
composer require haydarsahin/cache-migration
Run migration for creating cache-migrations
table.
php artisan migrate
Usage
The cache migrations is analogous with normal migration.
Create a migration file.
php artisan make:cache-migration UsersCacheForget
Type pattern or patterns which you want to forget to patterns array.
<?php class UserCacheForget { /* |-------------------------------------------------------------------------- | Cache Migration File |-------------------------------------------------------------------------- | | Redis keys that you wish to clear should be added to the patterns array. | Invalid patterns: '*', less than 3 characters. | */ public $patterns = [ 'users:*', 'report:users:*:performance:*:dateRange:*:volumes', 'specificCacheKey:101:userId' ]; }
Run pending migrations manually or add this code to your deployment pipeline.
php artisan cache:migrate
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security
If you discover any security related issues, please email instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.