PHPackages                             driftingly/rector-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. driftingly/rector-laravel

ActiveRector-extension[Parsing &amp; Serialization](/categories/parsing)

driftingly/rector-laravel
=========================

Rector upgrades rules for Laravel Framework

2.2.0(2mo ago)1.2k12.0M—7.5%104[19 issues](https://github.com/driftingly/rector-laravel/issues)[10 PRs](https://github.com/driftingly/rector-laravel/pulls)20MITPHPPHP ^7.4 || ^8.0CI passing

Since Mar 21Pushed 3d ago15 watchersCompare

[ Source](https://github.com/driftingly/rector-laravel)[ Packagist](https://packagist.org/packages/driftingly/rector-laravel)[ RSS](/packages/driftingly-rector-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (99)Used By (20)

[![](./banner.png)](./banner.png)

Rector Rules for Laravel
========================

[](#rector-rules-for-laravel)

[![Tests](https://github.com/driftingly/rector-laravel/actions/workflows/tests.yaml/badge.svg)](https://github.com/driftingly/rector-laravel/actions/workflows/tests.yaml)[![Code Analysis](https://github.com/driftingly/rector-laravel/actions/workflows/code_analysis.yaml/badge.svg)](https://github.com/driftingly/rector-laravel/actions/workflows/code_analysis.yaml)[![Packagist Downloads](https://camo.githubusercontent.com/1d248639524ebdd8a30548a0140161e7b3101debd59e530faed0c60402649dff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6472696674696e676c792f726563746f722d6c61726176656c)](https://packagist.org/packages/driftingly/rector-laravel/stats)[![Packagist Version](https://camo.githubusercontent.com/3f11fb285ffb56a25ecab5c1ae4c4118856787e0567f1e48ee58c7a4936da86e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6472696674696e676c792f726563746f722d6c61726176656c)](https://packagist.org/packages/driftingly/rector-laravel)

Available Rules
---------------

[](#available-rules)

See all available Laravel rules [here](/docs/rector_rules_overview.md). This list includes even the rules that are not yet released, but are available under the `dev-main` branch.

You can also find the released rules on the Rector [Find Rule](https://getrector.com/find-rule?activeRectorSetGroup=laravel) page.

Install
-------

[](#install)

This package is a [Rector](https://github.com/rectorphp/rector) extension developed by the Laravel community.

Rules for additional first party packages are included as well e.g. Cashier and Livewire.

Install as a dev dependency:

```
composer require --dev driftingly/rector-laravel
```

Automate Laravel Upgrades
-------------------------

[](#automate-laravel-upgrades)

To automatically apply the correct rules depending on the version of Laravel (or other packages) you are currently on (as detected in the `composer.json`), use the following:

```
