Outsource Laravel Development Partner - $3200/Month | Bacancy

Detect and Clean Up Unchanged Vendor Files with Laravel Vendor Cleanup

Last updated on by

Detect and Clean Up Unchanged Vendor Files with Laravel Vendor Cleanup image

Ever wondered which of your published Laravel config files you’ve actually customized? After years of development, published vendor files accumulate—some modified, many untouched, others orphaned from long-removed packages. This cruft makes your codebase harder to navigate and can cause confusion during package upgrades.

Laravel Vendor Cleanup by Chris Jones provides Artisan commands that intelligently compare your published vendor files with their originals. It strips comments, optionally normalizes whitespace, then uses SHA256 hashing to show exactly which files you've modified (with color-coded diff percentages), which are identical to vendor (safe to delete), and which are orphaned from removed packages.

Clean up cruft, track your customizations, and upgrade packages with confidence—all with simple artisan commands.

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 🟣 or Red 🔴 based on the 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

Available Commands

Here are the commands that are available at the time of writing:

php artisan vendor-cleanup:config
 
php artisan vendor-cleanup:migration
 
php artisan vendor-cleanup:lang
 
php artisan vendor-cleanup:view

Example

Here is an example of the output from the vendor-cleanup:config artisan command:

$ php artisan vendor-cleanup:config
 
MODIFIED
+---------------------+------------+
| File | Difference |
+---------------------+------------+
| config/services.php | 25.7% |
| config/app.php | 22% |
| config/mail.php | 4.7% |
| config/cache.php | 3% |
| config/queue.php | 1.7% |
| config/database.php | 0.8% |
| config/session.php | 0.4% |
| config/apiroute.php | 0.1% |
+---------------------+------------+
 
UNCHANGED (matches vendor)
+--------------------+------------------------+
| File | File |
+--------------------+------------------------+
| config/auth.php | config/filesystems.php |
| config/logging.php | |
+--------------------+------------------------+
 
MISSING (not published locally)
+-------------------------------------------------------------------+--------------------------------------------+
| File | File |
+-------------------------------------------------------------------+--------------------------------------------+
| laravel/boost/config/boost.php | laravel/framework/config/broadcasting.php |
| laravel/framework/config/concurrency.php | laravel/framework/config/cors.php |
| laravel/framework/config/hashing.php | laravel/framework/config/view.php |
| laravel/mcp/config/mcp.php | laravel/tinker/config/tinker.php |
| mrpunyapal/laravel-extended-commands/config/extended-commands.php | spatie/laravel-data/config/data.php |
| spatie/php-structure-discoverer/config/structure-discoverer.php | symfony/http-kernel/config/FileLocator.php |
+-------------------------------------------------------------------+--------------------------------------------+
 
Done.

Give this package a try on an existing project and see what it finds for you. Learn more and view the source code on GitHub.

Yannick Lyn Fatt photo

Staff Writer at Laravel News and Full stack web developer.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Jump24 - UK Laravel Agency

Laravel Developers that Click into Place. Never outsourced. Never offshored. Always exceptional.

Visit Jump24 - UK Laravel Agency
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $3200/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit

The latest

View all →
Handling Large Datasets with Pagination and Cursors in Laravel MongoDB image

Handling Large Datasets with Pagination and Cursors in Laravel MongoDB

Read article
Driver-Based Architecture in Spatie's Laravel PDF v2 image

Driver-Based Architecture in Spatie's Laravel PDF v2

Read article
Why Your Livewire Dashboard Jumps (And How to Fix It) - Laravel In Practice EP18 image

Why Your Livewire Dashboard Jumps (And How to Fix It) - Laravel In Practice EP18

Read article
Laravel Live UK returns to London on June 18-19, 2026 image

Laravel Live UK returns to London on June 18-19, 2026

Read article
Laravel Related Content: Semantic Relationships Using pgvector image

Laravel Related Content: Semantic Relationships Using pgvector

Read article
Filament v5.2.0 Adds a Callout Component image

Filament v5.2.0 Adds a Callout Component

Read article