When using file as cache driver, Laravel creates cache files but never purges expired ones. This can lead to server overload of cache files which drained up storage spaces.
This package creates an artisan command cache:cleanup
that will clean up your cache files, removing any that had expired.
You may run this manually or include it in a schedule.
Thanks to TerrePorter for his suggestion on laravel.io!
Thanks to jdavidbakr for his packagist but I decided to learn how to create my own packagist and how this formed!
Via Composer
$ composer require momokang/laravel-clean-file-cache
Then add the service provider to app/Console/Kernel.php
in the $commands array:
\momokang\CleanFileCache\CleanFileCache::class
$ php artisan cache:cleanup
$ php artisan cache:cleanup 48
where 48 is known as 48 hours, you can change the integer to suit your needs
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please raise an issue.
The MIT License (MIT). Please see License File for more information.