muhammadsadeeq/laravel-upgrades-rector

Automated Laravel version upgrade rules for Rector. Supports Laravel 10 through 13 with 64 rules covering breaking changes, dependency updates, and contract migrations.

Maintainers

Package info

github.com/MuhammadSadeeq/laravel-upgrades-rector

Homepage

Issues

Documentation

Type:rector-extension

pkg:composer/muhammadsadeeq/laravel-upgrades-rector

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

v1.0.2 2026-04-08 16:30 UTC

This package is auto-updated.

Last update: 2026-04-08 16:44:52 UTC


README

Laravel Upgrades Rector Logo

Laravel Upgrades Rector

Latest Version on Packagist Total Downloads Tests

Automate your Laravel upgrades with 64 Rector rules covering Laravel 10 through 13.

Installation

composer require --dev muhammadsadeeq/laravel-upgrades-rector

Usage

# Preview changes
vendor/bin/rector process --dry-run --config=vendor/muhammadsadeeq/laravel-upgrades-rector/config/laravel-13.php

# Apply changes
vendor/bin/rector process --config=vendor/muhammadsadeeq/laravel-upgrades-rector/config/laravel-13.php

Replace laravel-13.php with laravel-12.php or laravel-11.php for older upgrades. These config names and set constants refer to the target upgrade version, so laravel-13.php / LaravelUpgradeSetList::LARAVEL_13 means “upgrade the project to Laravel 13.” The Laravel 11, Laravel 12, and Laravel 13 sets can also rewrite the nearest project composer.json when a supported dependency update applies.

Supported Versions

Upgrade Path Rules
Laravel 12 → 13 20 rules
Laravel 11 → 12 14 rules
Laravel 10 → 11 31 rules

Cumulative sets are available to upgrade across multiple versions at once.

Custom Configuration

<?php

use Rector\Config\RectorConfig;
use MuhammadSadeeq\LaravelUpgradesRector\Set\LaravelUpgradeSetList;

return RectorConfig::configure()
    ->withSets([
        LaravelUpgradeSetList::LARAVEL_13,
        // LARAVEL_11, LARAVEL_12, LARAVEL_13 for single-version upgrades
        // UP_TO_LARAVEL_12, UP_TO_LARAVEL_13 for cumulative upgrades
    ])
    ->withPaths([
        __DIR__ . '/app',
        __DIR__ . '/bootstrap',
        __DIR__ . '/config',
        __DIR__ . '/database',
    ]);

Documentation

Full Documentation — Detailed rule reference, example transformations, architecture overview, and troubleshooting.

Testing

composer test
composer analyse

Current verification: 279 tests, 407 assertions, and PHPStan at max level with zero errors.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

Credits

License

The MIT License (MIT). Please see LICENSE.md for more information.