Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Rector Laravel

Rector Laravel Laravel Package

rector/rector-laravel

Community Rector extension to automate Laravel upgrades. Adds Laravel and first-party package rules (e.g., Cashier, Livewire), with version-based set providers that detect your composer.json or manual level sets to apply the right refactors for your target Laravel version.

View on GitHub
Deep Wiki
Context7

Rector upgrades rules for Laravel

Frequently asked questions about Rector Laravel
How do I install `driftingly/rector-laravel` for Laravel upgrades?
Run `composer require --dev driftingly/rector-laravel` to install it as a dev dependency. No runtime dependencies or server changes are required. The package integrates directly with Rector’s existing CLI.
Can I upgrade from Laravel 8 to 13 in one go, or should I do it incrementally?
While possible, incremental upgrades are safer. Use `LaravelLevelSetList::UP_TO_LARAVEL_130` for a full upgrade path, but test each version jump (e.g., 8→9, 9→10) separately in a staging environment to catch edge cases.
Does this package support Laravel Cashier or Livewire refactoring?
Yes. The package includes rules for Laravel Cashier (e.g., subscription changes) and Livewire (e.g., component syntax updates). These are included in version-specific sets like `LaravelLevelSetList::UP_TO_LARAVEL_130`.
How do I configure Rector to auto-detect my Laravel version from `composer.json`?
Use `withComposerBased(laravel: true)` in your Rector config. This automatically applies the correct version-specific rules based on your `composer.json` without manual set selection.
What’s the safest way to test Rector Laravel rules before applying them?
Run Rector in dry mode with `--dry-run` to preview changes. Compare the diff with `git diff` and validate against unit tests or manual review. For large codebases, use `--parallel` to speed up analysis.
Will this break existing migrations or custom logic during refactoring?
Some rules (e.g., `RemoveModelPropertyFromFactoriesRector`) may conflict with migrations or custom logic. Test in a staging environment first, and disable problematic rules via `->withSkip()` in your config.
Can I customize or extend the rules for my project’s specific needs?
Yes. Use `composer make:rule` to create custom rules, or override existing ones by extending Rector’s rule classes. The package supports tailoring for project-specific patterns (e.g., naming conventions).
Does `driftingly/rector-laravel` work with PHP 8.0 or older Laravel versions?
No. The package requires **PHP 8.1+** and **Laravel 9+** due to Rector’s underlying dependencies. For older versions, consider upgrading PHP/Laravel first or use a legacy-compatible Rector fork.
How do I integrate this into CI/CD for automated Laravel upgrades?
Add a step to your pipeline (e.g., GitHub Actions) to run Rector with `--dry-run` in PR checks or nightly upgrades. Example workflows are provided in the repo. Use feature flags or canary deployments for high-risk refactors.
What are the performance implications for large Laravel codebases?
Large codebases may slow down analysis. Mitigate this by excluding irrelevant directories with `--exclude-paths`, running rules in parallel (`--parallel`), or splitting refactors into smaller batches (e.g., by module).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky