sandermuller/laravel-fluent-validation
Type-safe, IDE-autocomplete Laravel validation rule builders. Create rules fluently without memorizing strings; each rule exposes only valid methods. Define nested array validation with each()/children(). Optional HasFluentRules trait speeds wildcard validation dramatically (up to 160x).
Validator class but with a cleaner interface. No breaking changes to Laravel’s core validation system.Rule objects for edge cases (e.g., authorization via ->rule()).HasFluentRules trait or FluentFormRequest base class enables adoption with zero breaking changes to existing rules() methods.'name|required|string') remain functional, allowing gradual migration.->messageFor('field', 'custom')).TestCase. Includes a FluentRulesTester helper for validation assertions.HasFluentValidation) for form validation in these frameworks, though Filament requires a workaround.'name|required|string' → FluentRule::string()->required()).rules() methods with fluent equivalents, starting with simple fields (e.g., email, string).items.*.name) using each()/children().Rule objects with fluent equivalents where possible (e.g., Rule::unique() → ->unique('table')).FluentRulesTester or Pest expectations.ValidationRule contract).Rule objects can coexist via ->rule() escape hatch.Rule::when()) are supported via ->when() with closures.composer.json to require sandermuller/laravel-fluent-validation and sandermuller/laravel-fluent-validation-rector.vendor/bin/rector process).FluentRulesTester or Pest expectations.->rule() for unsupported cases).FluentRuleContract) catches errors at compile time (e.g., calling min() on a date rule).each(), children()) reduce duplication and improve readability.each() chains or invalid rule combinations.->min(2)->max(255) vs. 'min:2|max:255').How can I help you explore Laravel packages today?