Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

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
Laravel Cloud

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

Visit Laravel Cloud
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
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
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
MongoDB logo

MongoDB

Enhance your PHP applications with the powerful integration of MongoDB and Laravel, empowering developers to build applications with ease and efficiency. Support transactional, search, analytics and mobile use cases while using the familiar Eloquent APIs. Discover how MongoDB's flexible, modern database can transform your Laravel applications.

MongoDB

The latest

View all →
Launch Your Dream SaaS Application with SaaSykit image

Launch Your Dream SaaS Application with SaaSykit

Read article
Generate, Parse, and Convert Documents in PHP with Paperdoc image

Generate, Parse, and Convert Documents in PHP with Paperdoc

Read article
Spatie Shares Their Coding Guidelines as AI Skills image

Spatie Shares Their Coding Guidelines as AI Skills

Read article
AI Generative Engine Optimization for Laravel image

AI Generative Engine Optimization for Laravel

Read article
Attach PDFs Directly to Mailables in laravel-pdf 2.6.0 image

Attach PDFs Directly to Mailables in laravel-pdf 2.6.0

Read article
Ship AI with Laravel: Your AI Agent Has Amnesia. Let's Fix It. image

Ship AI with Laravel: Your AI Agent Has Amnesia. Let's Fix It.

Read article