PHPackages                             momokang/laravel-clean-file-cache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. momokang/laravel-clean-file-cache

ActiveLibrary[Caching](/categories/caching)

momokang/laravel-clean-file-cache
=================================

Clean up expired laravel cache files if system is using file as cache driver

1.1(7y ago)0109MITPHPPHP &gt;=5.6.4

Since Oct 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/momokang/laravel-clean-file-cache)[ Packagist](https://packagist.org/packages/momokang/laravel-clean-file-cache)[ RSS](/packages/momokang-laravel-clean-file-cache/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (3)Used By (0)

LaravelCleanFileCache
=====================

[](#laravelcleanfilecache)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

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](http://laravel.io/user/TerrePorter) for his suggestion on [laravel.io](http://laravel.io/forum/01-28-2016-cache-file-garbage-collection)!

Thanks to [jdavidbakr](https://github.com/jdavidbakr/laravel-cache-garbage-collector) for his packagist but I decided to learn how to create my own packagist and how this formed!

Install
-------

[](#install)

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
```

Usage
-----

[](#usage)

```
$ 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

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please raise an issue.

Credits
-------

[](#credits)

- [momokang](https://github.com/momokang/)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Total

2

Last Release

2759d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5172626?v=4)[Kang](/maintainers/momokang)[@momokang](https://github.com/momokang)

---

Top Contributors

[![momokang](https://avatars.githubusercontent.com/u/5172626?v=4)](https://github.com/momokang "momokang (8 commits)")

---

Tags

LaravelCleanFileCache

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/momokang-laravel-clean-file-cache/health.svg)

```
[![Health](https://phpackages.com/badges/momokang-laravel-clean-file-cache/health.svg)](https://phpackages.com/packages/momokang-laravel-clean-file-cache)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
