driftingly/rector-laravel
Rector extension for Laravel that applies automated refactors and upgrade rules based on your composer.json or selected Laravel version sets. Includes rules for core Laravel and first‑party packages like Cashier and Livewire.
empty() → blank(), Facades → DI, dd() removal) via LARAVEL_CODE_QUALITY set.abort() → abort_if()) to align with current Laravel best practices without full rewrite.array_access_data() → Arr::get()).where() → whereLike()).Adopt when:
Look elsewhere if:
"This tool cuts Laravel upgrade time from weeks to days by automating 90% of breaking-change refactoring. For our [X] project migrating from Laravel 10 to 13, it would save [Y] developer-weeks and reduce upgrade risk by 60% (based on similar projects at [Company Z]). It’s a low-code, high-impact way to modernize our tech stack without hiring additional engineers."
Key Metrics to Highlight:
*"Rector Laravel future-proofs our codebase by:
array_* helpers → Arr::*).blank()/filled()) via CI.How It Works:
composer.json Laravel version and applies the right rules.Example Win: [Team A] used it to upgrade a 200K LoC app from Laravel 8 to 13 in 3 days (vs. 3 months manually). We can replicate this for [Project B]."*
Call to Action:
rector process src/Modules/Analytics --dry-run).*"Stop wasting time on boilerplate refactoring—let Rector Laravel handle it:
composer require driftingly/rector-laravel --dev
vendor/bin/rector process src --dry-run
Route::get('/user', 'UserController@index') → [UserController::class, 'index'].abort(404) → abort_if(true, fn() => abort(404)).dd($user) → removed in CI (configurable).LARAVEL_STATIC_TO_INJECTION teach you better practices while fixing code.Pro Tip: Use LARAVEL_CODE_QUALITY set to auto-improve your codebase without breaking it."*
Getting Started:
composer require --dev driftingly/rector-laravel.rector.php (see docs).vendor/bin/rector process src --dry-run.How can I help you explore Laravel packages today?