PHPackages                             leek/laravel-vendor-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. [Database &amp; ORM](/categories/database)
4. /
5. leek/laravel-vendor-cleanup

ActiveLibrary[Database &amp; ORM](/categories/database)

leek/laravel-vendor-cleanup
===========================

Laravel commands to detect and clean up unchanged vendor-published files (configs, migrations, views, lang files)

v0.9.0(6mo ago)6814.1k↓28.7%MITPHPPHP ^8.2CI passing

Since Oct 31Pushed 1mo agoCompare

[ Source](https://github.com/leek/laravel-vendor-cleanup)[ Packagist](https://packagist.org/packages/leek/laravel-vendor-cleanup)[ RSS](/packages/leek-laravel-vendor-cleanup/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Vendor Cleanup
======================

[](#laravel-vendor-cleanup)

> Detect and clean up unchanged vendor-published files in your Laravel application.

[![image](https://private-user-images.githubusercontent.com/60204/508001896-671ac9a9-4a1b-4b11-bd08-463f48dea1d1.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyODY5NjcsIm5iZiI6MTc3NTI4NjY2NywicGF0aCI6Ii82MDIwNC81MDgwMDE4OTYtNjcxYWM5YTktNGExYi00YjExLWJkMDgtNDYzZjQ4ZGVhMWQxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA0VDA3MTEwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZkZTdmODRkMjdhY2Q3ZTQxY2QzOGUxYmQ5ODljOTU2YzhlODgwYTI1NDNmZjE2ODMxOGE1ZGE4ZWYyOTNhYmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.r2dlVtIp3k_MdkcJvv5JowVO5o5QmLW2zNI0uUXPJNI)](https://private-user-images.githubusercontent.com/60204/508001896-671ac9a9-4a1b-4b11-bd08-463f48dea1d1.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyODY5NjcsIm5iZiI6MTc3NTI4NjY2NywicGF0aCI6Ii82MDIwNC81MDgwMDE4OTYtNjcxYWM5YTktNGExYi00YjExLWJkMDgtNDYzZjQ4ZGVhMWQxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA0VDA3MTEwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZkZTdmODRkMjdhY2Q3ZTQxY2QzOGUxYmQ5ODljOTU2YzhlODgwYTI1NDNmZjE2ODMxOGE1ZGE4ZWYyOTNhYmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.r2dlVtIp3k_MdkcJvv5JowVO5o5QmLW2zNI0uUXPJNI)---

This package provides Artisan commands to compare published vendor files (configs, migrations, views, lang files) with their originals in the vendor directory. Find out which files you've modified, which are identical to vendor (cruft), and which files are orphaned from removed packages.

Features
--------

[](#features)

- 🔍 **Smart Comparison** - Automatically strips PHP comments and optionally normalizes whitespace
- 📊 **Diff Percentages** - See exactly how different your files are from vendor originals
- 🎨 **Color-Coded Output** - Green/yellow/magenta/red based on difference percentage
- 🗑️ **Safe Cleanup** - Optionally delete unchanged files with confirmation
- 🏷️ **Orphan Detection** - Find files from uninstalled packages
- 📦 **Handles Timestamps** - Smart migration filename matching (strips timestamps)
- 🔧 **Stub Support** - Detects both `.php` and `.php.stub` vendor files

Installation
------------

[](#installation)

```
composer require leek/laravel-vendor-cleanup --dev
```

The package will auto-register via Laravel's package discovery.

Usage
-----

[](#usage)

### Config Files

[](#config-files)

Compare published config files with vendor originals:

```
php artisan vendor-cleanup:config
```

With options:

```
# Delete unchanged config files after confirmation
php artisan vendor-cleanup:config --delete

# Normalize whitespace in addition to stripping comments
php artisan vendor-cleanup:config --normalize
```

### Migration Files

[](#migration-files)

Compare published migrations with vendor originals (handles timestamped filenames):

```
php artisan vendor-cleanup:migration
```

### Lang Files

[](#lang-files)

Compare published language files (supports nested directories and JSON files):

```
php artisan vendor-cleanup:lang
```

### View Files

[](#view-files)

Compare published view files in `resources/views/vendor/`:

```
php artisan vendor-cleanup:view
```

Output Categories
-----------------

[](#output-categories)

Each command categorizes files into four groups:

### MODIFIED (color-coded by % different)

[](#modified-color-coded-by--different)

Files you've customized, sorted by difference percentage:

- 🟢 Green (&lt; 5%) - Very minor changes
- 🟡 Yellow (&lt; 15%) - Small changes
- 🟣 Magenta (&lt; 30%) - Moderate changes
- 🔴 Red (≥ 30%) - Significant changes

### UNCHANGED

[](#unchanged)

Files identical to vendor - potential candidates for deletion to reduce cruft.

### ORPHANED

[](#orphaned)

Files with no vendor counterpart - either from removed packages or your own application-specific files.

### MISSING

[](#missing)

Vendor files not yet published locally - available if you need them.

How It Works
------------

[](#how-it-works)

1. **Finds all vendor files** matching the file type (configs, migrations, etc.)
2. **Strips PHP comments** from both vendor and local files for comparison
3. **Optionally normalizes** whitespace with `--normalize` flag
4. **Compares** files using SHA256 hashing and similarity algorithms
5. **Categorizes** results and displays with color-coded diff percentages

For migrations, the command intelligently strips timestamps from filenames before matching (e.g., `2024_01_15_123456_create_jobs_table.php` matches `create_jobs_table.php`).

Options
-------

[](#options)

All commands support these options:

- `--delete` - Interactively delete unchanged files after showing results
- `--normalize` - Also normalize whitespace and line endings (comments are always ignored)

Why Use This?
-------------

[](#why-use-this)

- **Reduce Cruft** - Delete unchanged published files and rely on vendor defaults
- **Track Customizations** - Quickly see which vendor files you've modified
- **Find Orphans** - Identify leftover files from removed packages
- **Upgrade Confidence** - Know exactly what you've changed before upgrading packages

Example Output
--------------

[](#example-output)

```
MODIFIED
+----------------------+------------+
| File                 | Difference |
+----------------------+------------+
| config/services.php  | 65.3%      |
| config/app.php       | 38%        |
| config/database.php  | 9.8%       |
+----------------------+------------+

UNCHANGED (matches vendor)
+------------------------+--------------------+
| File                   | File               |
+------------------------+--------------------+
| config/filesystems.php | config/mail.php    |
| config/cache.php       | config/session.php |
+------------------------+--------------------+

ORPHANED (no vendor counterpart)
+---------------------------+------------------------------+
| File                      | File                         |
+---------------------------+------------------------------+
| config/custom-package.php | config/old-dependency.php    |
+---------------------------+------------------------------+

MISSING (not published locally)
+------------------------------------+-------------------------------------+
| File                               | File                                |
+------------------------------------+-------------------------------------+
| vendor/package/config/optional.php | vendor/another/config/settings.php  |
+------------------------------------+-------------------------------------+

Done.

```

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11.x or 12.x

License
-------

[](#license)

MIT

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance79

Regular maintenance activity

Popularity39

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 58.8% 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

Unknown

Total

1

Last Release

200d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e11ad2f75cb1d558136f1982458d541d96fb84a217d6a82e8c18df2ff503964b?d=identicon)[leek](/maintainers/leek)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![leek](https://avatars.githubusercontent.com/u/60204?v=4)](https://github.com/leek "leek (6 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (1 commits)")

---

Tags

laravellaravel-packagedifflaravelmigrationconfigviewlangvendorcleanuppublishedcruft

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/leek-laravel-vendor-cleanup/health.svg)

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

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[orchestra/tenanti

Tenant based Database Schema Manager for Laravel

588123.8k](/packages/orchestra-tenanti)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)

PHPackages © 2026

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