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.11.0(3mo ago)7035.1k↓59.5%[11 PRs](https://github.com/leek/laravel-vendor-cleanup/pulls)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 2w ago

READMEChangelog (2)Dependencies (10)Versions (17)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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODU1MTQ0NDIsIm5iZiI6MTc4NTUxNDE0MiwicGF0aCI6Ii82MDIwNC81MDgwMDE4OTYtNjcxYWM5YTktNGExYi00YjExLWJkMDgtNDYzZjQ4ZGVhMWQxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA3MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3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Fl-FyK8pJGjgr3FJ6OQyfQ)---

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

49

—

FairBetter than 94% of packages

Maintenance85

Actively maintained with recent releases

Popularity41

Moderate usage in the ecosystem

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.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 ~93 days

Total

3

Last Release

105d 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] (11 commits)")[![leek](https://avatars.githubusercontent.com/u/60204?v=4)](https://github.com/leek "leek (7 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

[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M327](/packages/laravel-ai)[spatie/laravel-medialibrary

Associate files with Eloquent models

6.2k45.4M705](/packages/spatie-laravel-medialibrary)[illuminate/queue

The Illuminate Queue package.

20433.0M1.8k](/packages/illuminate-queue)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React/Svelte) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

5031.3k](/packages/erag-laravel-lang-sync-inertia)[moonshine/moonshine

Laravel administration panel

1.3k268.2k89](/packages/moonshine-moonshine)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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