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 Laravel Package

symfony/form

Symfony Form lets you build, process, and reuse HTML forms in PHP with a flexible, component-based API. Handle validation, data mapping, and rendering with ease in any Symfony or standalone app.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • symfony/form is a framework-agnostic, standalone PHP component (a read-only subtree split of the symfony/symfony monorepo). It provides the form abstraction layer itself: FormType definitions, data mappers, model/view transformers, an event-driven lifecycle (PRE_SET_DATA, POST_SUBMIT, etc.), and an optional validator bridge.
  • Laravel fit is coexistence, not native. Laravel does not ship symfony/form; its idioms are FormRequest + Illuminate\Validation + Blade + Eloquent. Adopting this package means running a second, parallel form and validation model alongside the Laravel-native one.
  • Where it fits well: deeply nested or dynamic forms (CollectionType), DTO/command-style input mapping, form definitions reused across multiple entry points, and multi-step flows (FormFlow).
  • Where it fits poorly: simple CRUD forms, admin scaffolding (Filament/Nova), and codebases already committed to Livewire or Inertia with Laravel validation.

Integration feasibility

  • Request binding is viable: Illuminate\Http\Request extends Symfony\Component\HttpFoundation\Request, so HttpFoundationRequestHandler and UploadedFile handling work without a shim.
  • Real gaps we must close in-house:
    • Event dispatcher — the component expects Symfony\Contracts\EventDispatcher\EventDispatcherInterface, not illuminate/events.
    • Translator — TranslatorInterface vs Laravel's __()/translator; without an adapter, validation messages come back untranslated. Both 8.1.8 and now 8.1.9 are dominated by translation reviews (Tagalog, Bulgarian, Greek, Urdu, Japanese, Turkish, Persian) and malformed-placeholder fixes, which confirms the error strings are Symfony-catalog-owned, not Laravel-owned. Adopting means either consuming Symfony's catalogs or mapping them into lang/ deliberately.
    • CSRF — Symfony's CsrfExtension vs Laravel's VerifyCsrfToken/@csrf; running both is a common self-inflicted outage.
    • Validation — ValidatorExtension requires symfony/validator; Laravel's validator is a separate implementation.
    • Rendering — no official Blade bridge. symfony/twig-bridge is Twig-only, so form rendering must be hand-rolled as Blade components.
  • Effort estimate: a working vertical slice (service provider + adapters + one rendered form) is a 1–2 week spike. The rendering layer is the largest unknown and the most likely to be underestimated.

Technical risk

  • Overall remains medium, weighted toward integration, not the library itself. Core maturity is high: MIT, years of LTS support, predictable weekly patch cadence across 6.4/7.4/8.x.
  • Version gating is a hard constraint: Symfony 8 requires PHP >= 8.4; Symfony 7.x requires PHP >= 8.2. The pin must follow the fleet's PHP floor, not the newest tag.
  • FormFlow is still stabilizing — and 8.1.9 confirms it. v8.1.9 (2026-09-29) lands two further FormFlow correctness fixes on top of 8.1.8's creation/step-fallback/backward-navigation/reset fixes:
    • "Validate the data of the current step of a form flow" — validation is now scoped per step. This is a behavioral change, not just a defect fix: error surfacing, which step reports errors, and whether a partially valid flow can advance may differ from what we observed on 8.1.8. Any FormFlow spike output must be re-validated against 8.1.9.
    • "Fix FormFlow mutating session data written before 8.1" — implies that in-flight flow sessions created on earlier 8.1.x patches could be mutated/corrupted, and 8.1.9 corrects that handling. This is a migration concern, not only a bug fix: rolling 8.1.9 into a live environment with persisted flow state needs an explicit plan (flush flow session keys on deploy, or drain before cutover).
    • Conclusion unchanged in direction, sharper in emphasis: if multi-step flows are the justification for adoption, pin >= 8.1.9, budget for continued behavior changes on a patch cadence, and do not treat FormFlow state semantics as settled API.
  • Other 8.1.9 fixes touch surfaces we would realistically hit: enum type inference for private properties declared by parent classes (typed DTO mapping — which is exactly the DTO/command pattern we recommend), CurrencyType with active_at null (nullable model data), and ChoiceType placeholder remaining selectable when the parent form is optional (dynamic/nested forms). These are narrow, but they are the exact edges of the "complex forms" use case that motivates adoption.
  • Metadata caution: Dependents: 0 and the synthetic last-release timestamp are artifacts of a read-only split repo, not real signals. Do not use either for supply-chain or recency decisions — evaluate against symfony/symfony instead.
  • Changelog pattern is informative: patch traffic clusters precisely where we would lean — FormFlow state and validation, partial submits on expanded/multiple ChoiceType, session contamination by non-serializable objects, POST/file index merging in collections, duplicate errors from repeated ValidatorExtension instantiation, enum/type inference on mapped DTOs, ICU whitespace and placeholders in date/number transformers. 8.1.9 adds no new categories; it deepens two existing ones (FormFlow, ChoiceType). That is a stable risk profile, not a widening one.
  • Release character is benign: 8.1.9 is a translations-plus-bugfix patch — seven translation/typo entries, five bug fixes, no breaking changes, no deprecations reaching our adapter surface. It does not change the decision; it moves the floor.

Key questions

  • What concrete complexity driver justifies a second form layer (multi-step, dynamic collections, cross-field constraints, form reuse)?
  • What is the PHP floor across our fleet, and therefore which Symfony major line do we pin?
  • Who owns the Symfony↔Laravel adapters (dispatcher, translator, CSRF, rendering) after the spike ends?
  • Is validation authoritative in symfony/validator, Illuminate\Validation, or both — and what is the system of record for error messages?
  • Blade rendering: hand-rolled components, or do we accept a Twig dependency solely for form themes?
  • Does FormFlow's session-backed state model match our session driver, do we have stateless/API surfaces where it must be excluded, and are we prepared to absorb upstream behavior changes (including 8.1.9's per-step validation semantics) on a patch cadence?
  • Are we comfortable that issues and PRs live in symfony/symfony, not this repository?

Integration Approach

Stack fit

  • Composer additions: symfony/form, plus symfony/validator and symfony/event-dispatcher (or thin adapters over existing Laravel services). Skip symfony/twig-bridge if we stay Blade-only.
  • A Laravel service provider should bind: FormFactoryInterface (a FormFactory composed of explicitly chosen extensions), a Symfony\Contracts\EventDispatcher\EventDispatcherInterface adapter, a TranslatorInterface adapter, and a request handler reading from the current Illuminate\Http\Request.
  • Keep Eloquent out of FormType classes. Map submissions to DTOs/commands, then hydrate models in an application service. This is the main architectural payoff — and the biggest cultural shift from $request->validate(). Note the 8.1.9 enum-inference fix lands precisely on this pattern (private properties declared by parent classes), so typed DTO hierarchies are safe on >= 8.1.9 but should be regression-tested when we bump.

Migration path

  • Strangler pattern. New or rewritten complex forms adopt symfony/form first; leave existing CRUD on Laravel validation permanently.
  • Introduce a thin internal package (e.g. acme/forms) that owns the wiring, a base AbstractType, Blade components for label/input/error/CSRF, and a test helper. Application code depends on that package, never on symfony/form directly — this is what keeps an upgrade from becoming a codebase-wide refactor.
  • Enforce one validation story per form during transition. Never run both validators over the same payload.

Compatibility

  • Pin to the 7.4 LTS line unless the fleet is already on PHP 8.4+, in which case pin 8.1.9 or later. The 8.0.x line predates the FormFlow navigation fixes, and 8.1.0–8.1.8 predate both the per-step validation semantics and the pre-8.1 session-data fix in 8.1.9; do not select them.
  • Do not track the newest minor mid-rollout; bump minors only at a scheduled upgrade window. Patch bumps within 8.1.x are low-risk by changelog character but require FormFlow regression tests.
  • 8.1.9 rollout note: the session-data fix interacts with flow state written by earlier 8.1.x. On deploy, invalidate existing FormFlow session keys (or drain the flow before cutover) so no in-flight flow is rehydrated under changed semantics.
  • Disable Symfony's CsrfExtension and rely on Laravel middleware, or the reverse — never both.
  • Point the Symfony translator at Laravel's lang/ files, or ship Symfony's catalogs. 8.1.8 and 8.1.9 together are almost entirely translation review and malformed-placeholder cleanup; without a deliberate mapping we ship English-only error messages by accident, and fixes made upstream never reach our users.
  • Session-backed features (FormFlow, CSRF-token flows) assume stateful sessions. Exclude stateless/API surfaces or route them to the shared session store.

Sequencing

  1. Spike (1–2 weeks) — one genuinely non-trivial form end-to-end on Blade: submit, validation errors, file upload, one dynamic collection. Define success criteria up front (developer velocity, error-message parity, rendering effort). Pin the spike to >= 8.1.9 so it is not built against superseded FormFlow semantics.
  2. Adapter package, conventions, and a written "when to use symfony/form" rule documented in the repo.
  3. Two or three production forms, including one multi-step if that is on the roadmap — explicitly gated on a FormFlow spike revisited after 8.1.9, given two consecutive patches changing flow validation and session handling.
  4. Retrofit legacy complex forms only if the spike's metrics justify it. Default answer for legacy is "leave it."

Operational Impact

Maintenance

  • Core library maintenance is low: established release process, security policy, LTS branches, and backported fixes. Patch releases land weekly across three maintained lines; 8.1.x remains dominated by translation reviews plus a steady tail of small correctness fixes in the form-flow and choice/collection subsystems.
  • Our burden is the inverse shape. We own the Laravel adapters, the Blade rendering layer, and the upgrade path whenever Symfony moves its PHP floor or lands a deprecation. Budget roughly 10–15% of one engineer ongoing after the initial build, concentrated into two upgrade windows per year, plus per-bump FormFlow regression testing if multi-step is in scope.
  • Track upstream patches against our own form inventory rather than reading the split repo's changelog naively — most entries are translation noise, but FormFlow, ChoiceType placeholder, and collection-index fixes are signal.
  • Document that this repo is a read-only split; issues and PRs belong in symfony/symfony. Otherwise engineers will file reports that go nowhere.

Support

  • Community support is strong but Symfony-shaped: official docs, Stack Overflow, Symfony Slack. Questions like "how do I render this field in Blade" have no canonical answer — that knowledge lives with our adapter package owner.
  • Escape hatch is good: MIT, ordinary Composer library, patchable and forkable. No vendor relationship, so an edge-case fix is either upstream-wait or a locally maintained patch — factor that into SLAs for the forms we migrate. Upstream responsiveness is a positive signal: 8.1.9 shows FormFlow and enum-inference defects turned around within one patch cycle by the maintainer.

Scaling

  • Runtime cost is negligible against typical Laravel request overhead; form building is in-process with no extra network hops. Very large collection forms can get heavy in CPU/memory — cap collection cardinality and validate server-side.
  • Team scaling is the real constraint. Form types, data mappers, transformers, and form events are a distinct skill. Concentrate ownership in two or three engineers; everyone else consumes base types and Blade components.
  • Horizontal scaling is unaffected except where session-backed flow state is used — that must live in a shared store (Redis/DB), not the local filesystem.

Failure modes

  • Divergent validation between Illuminate and Symfony producing duplicate or contradictory errors on the same field.
  • Silent CSRF mismatch: form renders fine, submit always fails, no obvious error.
  • Rendering drift: hand-rolled Blade components diverge from expected field names, breaking _token, _method, or collection indices.
  • Multi-step flow defects: incorrect step fallback, broken backward navigation, reset behavior, and — as of 8.1.9 — which step's data is validated and when errors are reported. Regression-test navigation and per-step validation on every bump.
  • Session contamination or mutation in multi-step flows, including flow payloads written by earlier 8.1.x releases; keep flow state scalar-only and flush flow keys when rolling a patch that changes session handling.
  • Choice/placeholder regressions in nested optional forms: a required ChoiceType placeholder becoming non-selectable (or wrongly selectable) depending on parent optionality — covered in 8.1.9, so pin forward and cover with a rendering test.
  • Enum inference failing on private properties declared by parent classes when mapping to typed DTOs — fixed in 8.1.9; add a fixture to the adapter package's test suite.
  • Untranslated or malformed validation messages if the Symfony translator adapter is skipped, only partially wired for locales, or pinned behind an upstream placeholder fix.
  • Upgrade cliff when the PHP floor moves (Symfony 8 → PHP 8.4), which forces a coordinated runtime upgrade rather than an ordinary dependency bump.

Ramp-up

  • 2–4 weeks to productivity for an engineer fluent in Laravel but new to Symfony forms. The conceptual load is model vs. view transformers, data mappers, and form events — none of which have a Laravel analogue.
  • Mitigate with: one canonical reference form in the codebase, the internal adapter package, a short written guide, and a rule that new FormType classes get reviewed by the owning team.
  • Do not broaden adoption before the reference implementation and conventions exist. The cost of inconsistent form patterns across a Laravel codebase exceeds the cost of the library itself.
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.
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator