LaravelPackages.net
Acme Inc.
Toggle sidebar
jhdxr/laravel-prune-db-cache

Clear expired cache items in DB for laravel database driver

125
0
v0.0.3
About jhdxr/laravel-prune-db-cache

jhdxr/laravel-prune-db-cache is a Laravel package for clear expired cache items in db for laravel database driver. It currently has 0 GitHub stars and 125 downloads on Packagist (latest version v0.0.3). Install it with composer require jhdxr/laravel-prune-db-cache. Discover more Laravel packages by jhdxr or browse all Laravel packages to compare alternatives.

Last updated

Latest Stable Version License

Prune Expired Cache For Laravel DB Driver

The built-in database cache driver in Laravel does not have a built-in way to delete expired cache entries automatically, nor a quick way to clear the expired items only. This package helps you to handle this issue.

This package adds one artisan command: php artisan cache:db-prune-expired and it will delete all expired records from the cache table.

Installation

You can install the package via composer:

composer require jhdxr/laravel-prune-db-cache

Usage

Run the following command

php artisan cache:db-prune-expired

Run on schedule

It's very easy to use Laravel's built-in scheduler to run the command automatically. For example, if you want to run the command every day at 4 AM, you can add the following to your app/Console/Kernel.php file:

protected function schedule(Schedule $schedule)
{
    $schedule->command('cache:db-prune-expired')->dailyAt('04:00');
}

License

This package is open-sourced software licensed under the MIT license.

Star History Chart