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
SerpApi

The Web Search API for Your LLM and AI Applications

Visit SerpApi
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

The latest

View all →
The Laravel Community Mobile App Helps You Discover Events and Connect With Developers image

The Laravel Community Mobile App Helps You Discover Events and Connect With Developers

Read article
A PHP Package for Concurrent Website Crawling image

A PHP Package for Concurrent Website Crawling

Read article
A Clean API for Reading PHP Attributes image

A Clean API for Reading PHP Attributes

Read article
Serve Markdown Versions of Your Laravel Pages to AI Agents image

Serve Markdown Versions of Your Laravel Pages to AI Agents

Read article
The Inertia v3 Beta is Here image

The Inertia v3 Beta is Here

Read article
Polyscope Is an Ai-First Dev Environment for Orchestrating Agents image

Polyscope Is an Ai-First Dev Environment for Orchestrating Agents

Read article