laravel-fluent-validation-rector maintained by sandermuller
Description
Rector rules for migrating Laravel validation to sandermuller/laravel-fluent-validation
Author
Last update
2026/05/18 08:51
(dev-main)
License
Downloads
3 188
Tags
Last update
2026/05/18 08:51
License
Require
- php ^8.2
- rector/rector ^2.4.1
- symplify/rule-doc-generator-contracts ^11.2
- sandermuller/laravel-fluent-validation ^1.20
Last update
2026/05/11 15:17
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/05/06 11:46
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/29 17:07
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/29 13:49
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/29 11:24
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/29 06:30
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/29 06:23
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/28 21:50
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/28 21:04
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/28 17:25
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/28 13:49
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/28 13:21
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/28 11:55
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/28 09:52
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/28 09:07
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/27 23:09
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/27 21:34
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/27 15:10
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/27 14:29
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/27 13:26
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/27 12:59
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/26 23:09
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/26 13:59
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/26 11:49
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/26 00:06
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/25 13:05
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/24 23:28
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/24 21:50
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/24 14:33
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/24 13:05
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/24 08:39
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/23 20:54
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/23 16:58
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/22 21:59
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.20
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/22 18:42
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.19
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/22 16:37
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.19
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/21 10:13
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.17
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/20 22:43
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.17
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/20 22:23
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.17
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/17 16:48
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.8.1
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/17 16:02
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.8.1
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/17 12:47
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.8.1
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/15 15:28
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.8.1
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/15 15:26
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.8.1
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/15 12:38
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.8.1
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/15 11:51
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.8.1
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/15 11:48
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.8.1
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/15 10:24
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.8
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/15 08:38
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.7.1
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/14 23:59
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.7.1
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/14 23:54
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.7.1
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/14 23:29
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.7.1
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/14 09:13
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/13 23:13
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/13 23:02
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/13 22:28
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/13 22:13
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/13 19:15
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/13 18:58
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/13 18:54
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/13 18:04
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/13 16:10
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/13 08:50
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/12 23:01
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/12 22:28
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/12 22:09
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/12 19:09
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/12 19:09
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Last update
2026/04/12 17:06
License
Require
- php ^8.2
- rector/rector ^2.4.1
- sandermuller/laravel-fluent-validation ^1.0
- symplify/rule-doc-generator-contracts ^11.2
Laravel Fluent Validation Rector
Rector rules for migrating Laravel validation to sandermuller/laravel-fluent-validation.
Automates the bulk of a migration from native Laravel validation (pipe-delimited strings, array-based rules, Rule:: objects) to FluentRule method chains. In real-world testing against a production Laravel codebase, the rules converted 448 files across 3469 tests with zero regressions.
Installation
composer require --dev sandermuller/laravel-fluent-validation-rector
Usage
Quick start — run all rules
// rector.php
use Rector\Config\RectorConfig;
use SanderMuller\FluentValidationRector\Set\FluentValidationSetList;
return RectorConfig::configure()
->withPaths([__DIR__ . '/app'])
->withSets([FluentValidationSetList::ALL]);
vendor/bin/rector process --dry-run # preview changes
vendor/bin/rector process # apply them
vendor/bin/pint # fix code style after
Available sets
| Set | Rules | Description |
|---|---|---|
FluentValidationSetList::ALL |
Convert + Group + Traits | Full migration pipeline (excludes Simplify) |
FluentValidationSetList::CONVERT |
ValidationStringToFluentRuleRector, ValidationArrayToFluentRuleRector |
Convert pipe-delimited and array-based rules to FluentRule chains |
FluentValidationSetList::GROUP |
GroupWildcardRulesToEachRector |
Group flat wildcard keys into nested each()/children() calls |
FluentValidationSetList::TRAITS |
AddHasFluentRulesTraitRector, AddHasFluentValidationTraitRector |
Add performance traits to FormRequest and Livewire classes |
FluentValidationSetList::SIMPLIFY |
SimplifyFluentRuleRector |
Post-migration cleanup: factory shortcuts, min/max→between, label→factory arg |
Granular usage
// Just conversion, no grouping or traits:
->withSets([FluentValidationSetList::CONVERT])
// Conversion + traits, skip grouping:
->withSets([
FluentValidationSetList::CONVERT,
FluentValidationSetList::TRAITS,
])
// Post-migration simplification (run separately after verifying conversion):
->withSets([FluentValidationSetList::SIMPLIFY])
Individual rules
use SanderMuller\FluentValidationRector\Rector\ValidationStringToFluentRuleRector;
use SanderMuller\FluentValidationRector\Rector\ValidationArrayToFluentRuleRector;
return RectorConfig::configure()
->withRules([
ValidationStringToFluentRuleRector::class,
ValidationArrayToFluentRuleRector::class,
]);
Rules reference
| Rule | What it does |
|---|---|
ValidationStringToFluentRuleRector |
Pipe-delimited string rules ('required|string|max:255') into fluent chains. Context-aware: works in FormRequest rules(), $request->validate(), and Validator::make(). |
ValidationArrayToFluentRuleRector |
Array-based rules (['required', 'string', Rule::unique(...)]), including Rule:: objects, Password::min() chains, conditional tuples, closures, and custom rule objects. |
GroupWildcardRulesToEachRector |
Flat wildcard/dotted keys into nested each()/children() calls. Skips Livewire classes. Synthesizes FluentRule::array()->nullable() for parent keys without an explicit rule. |
AddHasFluentRulesTraitRector |
Adds use HasFluentRules; to FormRequest classes that use FluentRule (enables optimized validation). |
AddHasFluentValidationTraitRector |
Adds use HasFluentValidation; to Livewire components that use FluentRule. |
SimplifyFluentRuleRector |
Simplifies FluentRule chains: factory shortcuts (string()->url() → url()), label as factory arg, min/max → between, redundant type removal. |
Requirements
- PHP 8.2+
- Rector 2.4+
- sandermuller/laravel-fluent-validation ^1.0
License
MIT