muhammadsadeeq/laravel-upgrades-rector
Composer 安装命令:
composer require 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.
README 文档
README
Laravel Upgrades Rector
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.
They do not update composer.lock or install new packages for you.
The ready-to-use config files run only this package's Laravel upgrade rules; they do not enable Rector's generic PHP modernization/code-style sets. Generated files under bootstrap/cache are skipped.
Recommended Upgrade Flow
# 1. Rewrite application code and supported config patterns vendor/bin/rector process --config=vendor/muhammadsadeeq/laravel-upgrades-rector/config/laravel-11.php # 2. Install the upgraded framework and package versions composer update # 3. Run your test suite and application checks php artisan test
After Rector and Composer finish, review any generated advisory comments and TODO stubs before considering the upgrade complete.
Rule Types
- Auto-fix rules rewrite code or configuration when the upgrade can be applied safely
- Advisory rules add comments when the package can identify a Laravel upgrade concern but cannot safely rewrite project-specific behavior
- Contract stub rules add required interface methods, often with TODO comments where implementation is application-specific
Examples of advisory/manual-review areas include change() migrations, relationship methods named casts(), custom password rehashing behavior, and other behavior-sensitive upgrade-guide items.
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: 301 tests, 429 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.
muhammadsadeeq/laravel-upgrades-rector 适用场景与选型建议
muhammadsadeeq/laravel-upgrades-rector 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「migration」 「laravel」 「automation」 「upgrade」 「refactoring」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 muhammadsadeeq/laravel-upgrades-rector 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 muhammadsadeeq/laravel-upgrades-rector 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 muhammadsadeeq/laravel-upgrades-rector 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Lets you add foreign keys in a swift! Foreign key adder in laravel migration.
Manage PostgreSQL schemas in Laravel applications
Bitrix db migration core libs
The YADM migrations
Data migration mechanism for php using dbal do doctrine with pdo, schema and queryBuilder
Alfabank REST API integration
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 35
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-08