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
Bacancy

Outsource a dedicated Laravel developer for $3,200/month. With over a decade of experience in Laravel development, we deliver fast, high-quality, and cost-effective solutions at affordable rates.

Visit Bacancy
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
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 →
Generate Secure, Memorable Passphrases in PHP with PHP Passphrase image

Generate Secure, Memorable Passphrases in PHP with PHP Passphrase

Read article
FrankenPHP v1.11.2 Released With 30% Faster CGO, 40% Faster GC, and Security Patches image

FrankenPHP v1.11.2 Released With 30% Faster CGO, 40% Faster GC, and Security Patches

Read article
Capture Web Page Screenshots in Laravel with Spatie's Laravel Screenshot image

Capture Web Page Screenshots in Laravel with Spatie's Laravel Screenshot

Read article
Nimbus: An In-Browser API Testing Playground for Laravel image

Nimbus: An In-Browser API Testing Playground for Laravel

Read article
Laravel 12.51.0 Adds afterSending Callbacks, Validator whenFails, and MySQL Timeout image

Laravel 12.51.0 Adds afterSending Callbacks, Validator whenFails, and MySQL Timeout

Read article
Handling Large Datasets with Pagination and Cursors in Laravel MongoDB image

Handling Large Datasets with Pagination and Cursors in Laravel MongoDB

Read article