4,000 emails/month for free | Mailtrap sends real emails now!

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
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
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
Cut PHP Code Review Time & Bugs into Half with CodeRabbit logo

Cut PHP Code Review Time & Bugs into Half with CodeRabbit

CodeRabbit is an AI-powered code review tool that specializes in PHP and Laravel, running PHPStan and offering automated PR analysis, security checks, and custom review features while remaining free for open-source projects.

Cut PHP Code Review Time & Bugs into Half with CodeRabbit
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
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
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 →
A new beta of Laravel Wayfinder just dropped image

A new beta of Laravel Wayfinder just dropped

Read article
Ben Bjurstrom: Laravel is the best Vibecoding stack for 2026 image

Ben Bjurstrom: Laravel is the best Vibecoding stack for 2026

Read article
Laravel Altitude - Opinionated Claude Code agents and commands for TALL stack development image

Laravel Altitude - Opinionated Claude Code agents and commands for TALL stack development

Read article
JSON:API Resource in Laravel 12.45 image

JSON:API Resource in Laravel 12.45

Read article
Caching With MongoDB for Faster Laravel Apps image

Caching With MongoDB for Faster Laravel Apps

Read article
Laravel 12.44 Adds HTTP Client afterResponse() Callbacks image

Laravel 12.44 Adds HTTP Client afterResponse() Callbacks

Read article