sandermuller/laravel-fluent-validation
Fluent validation rule builders for Laravel: write rules with IDE autocompletion instead of string syntax. Each rule type exposes only applicable methods, each() and children() keep parent and child rules together, and the HasFluentRules trait speeds up wildcard validation.
Stance: adopt as a developer-experience layer behind a spike, not as a framework-level mandate. It sits on top of Laravel's validator and compiles down to native rule strings and closures, so the blast radius is contained — but it touches every FormRequest, which makes it a high-frequency, low-severity dependency.
Architecture fit
FluentRule is a static factory returning typed builders (StringRule, EmailRule, DateRule); output is consumable by Laravel's existing pipeline. No container bindings, no service provider coupling to application code, no changes to the validation contract.HasFluentRules trait or the FluentFormRequest base class. Also exposes a schema() builder and a RuleSet for build/compose/inspect/validate outside the request lifecycle.messages()/attributes() drift problem), and each()/children() co-locate parent and wildcard child rules instead of scattering dot-notation keys.->rule(['can', 'ability', ...])), so no capability is permanently blocked — the risk is that escape-hatch usage quietly becomes the norm and erodes the consistency benefit.Integration feasibility
each() chains, and Laravel Boost skills that feed the API reference to AI assistants. Livewire trait and a documented Filament workaround cover the common non-request surfaces.FluentRulesTester, Pest expectations), which matters more than it looks: validation is a regression-prone area, and QA needs to assert on rules without booting a full request.Technical risk
Key questions
Rule:: closures, conditional Rule::when, deeply nested dot-notation — or does it fail silently on some?Stack fit
Migration path
each() chains are bounded from day one, before patterns harden.Compatibility
rules() array, so migration can be per-field, per-request, per-module. This is the single most important property for sequencing: no big-bang required.rules() return against FluentRuleContract, not concrete builder classes, to keep refactors cheap.Sequencing
Maintenance
UPGRADING.md on every bump — the changelog and release notes are maintained, which is a positive signal.Support
Scaling
HasFluentRules replaces Laravel's O(n²) wildcard expansion with a single tree walk, and DB exists/unique checks against wildcard arrays batch into one whereIn instead of one query per item. On import and bulk-edit endpoints that is a query-count and latency reduction, not a micro-optimization.Failure modes
->rule([...]) usage.Ramp-up
each() for wildcards, escape hatch when uncovered) and point AI-assisted tooling at the shipped Boost skills to reduce onboarding friction.How can I help you explore Laravel packages today?