PHPackages                             rohits/laravel-dir-cleanup - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rohits/laravel-dir-cleanup

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rohits/laravel-dir-cleanup
==========================

1.2(5y ago)16MITPHP

Since Aug 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/shirkerohit/laravel-dir-cleanup)[ Packagist](https://packagist.org/packages/rohits/laravel-dir-cleanup)[ RSS](/packages/rohits-laravel-dir-cleanup/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

laravel-dir-cleanup
===================

[](#laravel-dir-cleanup)

Simple package to delete unwanted files from list of directories.

[![Latest Stable Version](https://camo.githubusercontent.com/6518d49a8784ef9d4628d0e3ec2062eefc913a40eea48d6cc64ae462a7e89444/68747470733a2f2f706f7365722e707567782e6f72672f726f686974732f6c61726176656c2d6469722d636c65616e75702f76)](//packagist.org/packages/rohits/laravel-dir-cleanup) [![Total Downloads](https://camo.githubusercontent.com/cfbca40559e7e7099062596d4838874544711a12e4298ab89520b05edc101f94/68747470733a2f2f706f7365722e707567782e6f72672f726f686974732f6c61726176656c2d6469722d636c65616e75702f646f776e6c6f616473)](//packagist.org/packages/rohits/laravel-dir-cleanup) [![Latest Unstable Version](https://camo.githubusercontent.com/f790bddfa35789203ac5276535d6a4bc18b3f8950155680decf493bd24225715/68747470733a2f2f706f7365722e707567782e6f72672f726f686974732f6c61726176656c2d6469722d636c65616e75702f762f756e737461626c65)](//packagist.org/packages/rohits/laravel-dir-cleanup) [![License](https://camo.githubusercontent.com/8caa5bbcb84dc8159df65d7d220da16a7d3cdcb14c930b91a8244548cada3c1d/68747470733a2f2f706f7365722e707567782e6f72672f726f686974732f6c61726176656c2d6469722d636c65616e75702f6c6963656e7365)](//packagist.org/packages/rohits/laravel-dir-cleanup)

Installation :
==============

[](#installation-)

Composer :
----------

[](#composer-)

`composer require rohits/laravel-dir-cleanup`

Usage :
-------

[](#usage-)

### Register service provider :

[](#register-service-provider-)

Open your app.config file and add following Line.

`Rohits\Src\CleanUpserviceProvider::class `

### Publish config File :

[](#publish-config-file-)

`php artisan vendor publish`

- choose appropriate provider here its `Rohits\Src\CleanUpserviceProvider` &amp; it should publish a file named `cleanup.php` under your config directory.

### Update config file :

[](#update-config-file-)

- root : Root folder under which you want to delete the files.
- directories : Specify the list of directories you want the package to iterate to delete files.
- level : Specify the depth of directory to iterate. By default all subdirectories will iterated till the last leaf node.
- extensions : Specify the extension to match for deleting files eg. csv  **Simply specify extension (eg. txt) without prefix (.)**
- log : Specify if you want to log the files deleted. This is intentionally kept disabled as you need to specify the directory of log file rather the flooding the default one.
- logDirectory : Name of the directory you want to keep the logs.
- logFileName : Name of the log file if any. By default a file with name cleanup\_log.txt will be used.

### Configure the cleanup :

[](#configure-the-cleanup-)

- The package ships with the command that help you schedule it when you want to run the cleanup. Just schedule the command as you would do a normal command.

```
     /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('cleanup-dirs')
            ->everyHour();
    }

```

- You can also manually run the cleanup CRON.

`php artisan cleanup-dirs`

 **(Note : Please make sure you run `php artisan config:clear` before you run the command.)**

### Tests :

[](#tests-)

Make sure php is in your path and simply run below command.

`vendor/bin/phpunit`

### Issues:

[](#issues)

Please report them @

### License :

[](#license-)

The MIT License.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.9% 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 ~2 days

Total

3

Last Release

2088d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/47ff8e2e6f589a76286ce1ee6e32be011c69f763bcb0f153a56a3eb0d99b4496?d=identicon)[rohits](/maintainers/rohits)

---

Top Contributors

[![shirkerohit](https://avatars.githubusercontent.com/u/31042658?v=4)](https://github.com/shirkerohit "shirkerohit (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

### Embed Badge

![Health badge](/badges/rohits-laravel-dir-cleanup/health.svg)

```
[![Health](https://phpackages.com/badges/rohits-laravel-dir-cleanup/health.svg)](https://phpackages.com/packages/rohits-laravel-dir-cleanup)
```

PHPackages © 2026

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