Weave 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

Form Request Validation For Filament Laravel Package

occ-therapist/form-request-validation-for-filament

Reuse Laravel Form Requests inside Filament: attach one to a schema or table filter and its rules, messages, and attributes apply automatically to matching fields, with wildcard mapping, context-aware per-page rules, and smart rule merging.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is a thin validation adapter between Laravel Form Requests and Filament schema components. That is a good architectural fit for Laravel/Filament admin codebases that already treat Form Requests as the canonical validation layer for API and controller endpoints. It avoids inventing a new validation DSL and reuses Laravel’s rules(), messages(), and attributes(). For a TPM, the leverage is clear: one source of truth for validation reduces drift between API validation and admin UI validation, which lowers defect rates and accelerates CRUD feature delivery. It is not a fit for API-only services, non-Filament admin UIs, or teams that intentionally keep UI validation separate from transport validation.

Integration feasibility. Integration is low-effort: Composer install, package discovery, and a single ->formRequest() or ->filtersFormRequest() call. The package covers Resource Create/Edit pages, standalone forms, action modals, wizards, relation managers, and table filters. Automatic field mapping by name, dot notation, and wildcards reduces per-field wiring. The main integration constraint is naming discipline: Form Request keys must align with Filament field state paths, and ->formRequest() must be called after ->components(). The package’s state-path normalization (data.*, mountedActions.*, tableDeferredFilters.*) mitigates Filament internal prefixes, but it remains a naming-convention dependency.

Technical risk. The primary risk is maturity, not architecture. The package has very low adoption signals: 5 GitHub stars, 0 dependents, a single maintainer, and a short release history. It constrains the platform to PHP 8.2+, Laravel 12/13, and Filament 4/5; Laravel 11 was explicitly dropped. Several Form Request lifecycle features are unsupported: authorize(), withValidator(), passedValidation(), failedValidation(), and per the README, prepareForValidation(). However, v1.3.1 release notes say prepareForValidation() support from v1.3.0 is unchanged. That contradiction is a documentation and behavior risk that must be resolved before relying on request preparation. Orphan rules do not show inline field errors; they surface as Filament notifications. Rule merging gives Form Request rules precedence on conflicts, which is sensible but can produce validation behavior that differs from the original Filament form. The simulated request also introduces a semantic gap versus a real HTTP request, especially for auth, tenant, route-parameter, and record-aware rules.

Key questions.

  • Is prepareForValidation() actually supported in the current release, and if so, what are the constraints?
  • How is the simulated request constructed, and does it correctly carry authenticated user, tenant, route parameters, and record context?
  • What is the test coverage and CI matrix across Filament 4 and Filament 5?
  • Are there production references beyond the repository’s own tests?
  • What is the maintainer’s support and release policy, and is there a contingency plan if the package is abandoned?
  • How does rule merging behave for complex rules such as Rule::unique(), required_if, and nested repeater wildcards?
  • Is authorize() intentionally out of scope, and are Filament policies mandatory in all resource contexts?

Integration Approach

Stack fit. Use this package only where the stack is Laravel 12/13, PHP 8.2+, and Filament 4.x or 5.x. It fits best in a monolithic Laravel application or a modular admin panel where Form Requests already exist for HTTP endpoints and the team wants those same rules inside Filament. It is a poor fit for Laravel 11 estates, Filament 3 applications, or teams without existing Form Request discipline, because the package amplifies an existing pattern rather than creating one.

Migration path. Start with one non-critical Resource Create/Edit form that already has corresponding Store*Request and Update*Request classes. Attach ->formRequest() with context-aware class selection, verify inline error mapping, confirm messages and attribute names, and test orphan-rule behavior. Once validated, extend to action modals and relation managers, then wizards, then table filters. Avoid a big-bang migration across all resources. For table filters, use deferred filters initially so validation runs on Apply rather than on every filter change.

Compatibility. Treat the package’s version constraints as a platform gate. Pin the package to a tested minor version and require an explicit compatibility review before upgrading Filament, Laravel, or PHP. The claimed Filament 4/5 adapter layer is important, but it must be verified in the application’s actual Filament version, not assumed from the README. Because the package has zero dependents, there is no ecosystem compatibility signal to rely on. Validate with the team’s existing Form Requests, especially those using unique, exists, tenant scoping, route parameters, and nested array rules.

Sequencing.

  1. Inventory existing Form Requests and Filament schemas; identify duplicated validation and candidate resources.
  2. Establish a naming convention between Form Request keys and Filament field names, including nested and repeater fields.
  3. Run a one-resource pilot on Create/Edit, including conflict-rule merging and orphan-rule tests.
  4. Document a standard usage pattern: ->components() first, then ->formRequest(), with a shared helper or base-resource convention to reduce lock-in.
  5. Expand to actions, wizards, relation managers, and table filters in that order.
  6. Add regression tests for validation errors, messages, attributes, orphan rules, and wizard step behavior.
  7. Gate future Filament/Laravel upgrades on a package compatibility check and a rollback plan.

Operational Impact

Maintenance. The package is small and MIT-licensed, so the code itself is low-maintenance. The operational concern is bus factor and release cadence. A TPM should assign ownership to a platform or backend lead for version pinning, upgrade testing, and vendor-risk review. Budget for a fork or internal replacement if the package stalls. Because the README has at least one material contradiction around prepareForValidation(), documentation maintenance and behavior verification are ongoing tasks, not one-time setup.

Support. Support burden will fall on the internal team, not the package maintainer. Developers need guidance on rule merging precedence, state-path normalization, orphan rules, and unsupported Form Request hooks. Create a short internal playbook with examples for Create/Edit, wizards, and filters. Make it explicit that authorization must remain in Filament policies and that authorize() in Form Requests is not enforced by this package.

Scaling. The package is validation glue, not a throughput bottleneck. The main scaling concern is validation frequency: live table filters validate on every change, and large repeaters or wizards can resolve Form Requests frequently. Prefer deferred filters and validate only active wizard steps, which the package supports. Monitor large schemas and complex rule sets during rollout. Architecturally, the package scales with the application’s Filament usage, but its maintainability scales poorly if the team adopts it everywhere without a convention and test coverage.

Failure modes.

  • ->formRequest() called before ->components() causes the validation hook to be attached incorrectly.
  • Field-name mismatches produce orphan rules that fail via notification instead of inline field errors.
  • Unsupported Form Request hooks are ignored or behave differently, especially prepareForValidation(), withValidator(), and authorize().
  • Simulated requests may miss tenant, route, or record context, causing incorrect unique or conditional rules.
  • Rule merging can override Filament-native constraints in ways that surprise developers.
  • Filament or Laravel upgrades may break the adapter layer.
  • Documentation contradictions around lifecycle hooks create false assumptions during implementation.
  • Low adoption means fewer community-reported edge cases and slower identification of regressions.

Ramp-up. Ramp-up is low for developers already comfortable with Laravel Form Requests and Filament schemas, likely half a day to one day for a pilot team. The real ramp-up is organizational: agreeing on field-naming standards, documenting supported versus unsupported Form Request features, and establishing upgrade ownership. A TPM should frame adoption as a bounded productivity bet: high leverage for duplicated validation in admin panels, but only after a pilot proves behavior on the team’s actual Filament version and Form Request patterns.

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.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log