- What is barryvdh/laravel-form-bridge used for?
- It is an adapter that registers Symfony Form Component bindings in Laravel's container so you can build forms with Symfony form types, builders, data transformers, and form events inside a Laravel application. It also ships a compatibility layer for Laravel 4-style Form and HTML helpers on Laravel 5+ via the Laravel Collective HTML package. It targets server-rendered, form-dense surfaces such as admin CRUD screens, entity create and edit pages, multi-step wizards, and nested collection editors.
- How do I install and configure laravel-form-bridge in Laravel?
- Install it with Composer using composer require barryvdh/laravel-form-bridge. The service provider is auto-discovered, so no manual registration step is needed on supported Laravel versions. Publishing the config file is optional and only necessary if you want to override defaults, and there are no queue, cache, or filesystem dependencies to configure.
- Which Laravel and PHP versions does laravel-form-bridge support?
- Release 0.7.5 explicitly widens coverage to Laravel 13.x and includes a PHP 8.5 CI lane, alongside support for earlier Laravel 5+ releases and PHP 8.x. The practical floor and ceiling are driven by the resolved symfony/form version, so pin that transitive dependency in your lockfile and verify it supports your PHP build. Check the repository CI matrix before adopting on a very new Laravel or PHP major.
- What is the difference between laravel-form-bridge and laravelcollective/html?
- laravelcollective/html provides the classic Form and HTML helper facade and is effectively unmaintained. This bridge is a Symfony Form adapter that also offers a compatibility layer so legacy Laravel 4-style helper usage keeps working on Laravel 5+. Migrating from Collective helpers to Symfony form types maps conceptually but is a syntactical rewrite rather than a drop-in port, so budget rework and add test coverage along the way.
- Does laravel-form-bridge preserve Laravel validation, CSRF, session old input, and Eloquent model binding?
- Yes, the design goal is to consume Symfony forms while preserving Laravel validation, session and old-input handling, CSRF protection, and Eloquent model binding. The bridge registers Symfony Form services in Laravel's container rather than replacing Laravel's request lifecycle. That coexistence is exactly why it is lower friction than swapping out your framework or templating engine.
- How do I render Symfony forms in Blade with laravel-form-bridge?
- Symfony form themes are built around Twig and do not map cleanly onto Blade, and this package does not solve that mismatch. Rendering is the most common place adoptions stall, so decide on a Blade convention per form type before committing, usually via partials or Blade components. Many teams accept more verbose templates in exchange for full control over markup and styling.
- How do I test forms built with barryvdh/laravel-form-bridge?
- Forms are constructed per request and the package itself is stateless, so you can resolve the form factory from the container and test form types in isolation by submitting plain arrays. Assert on isValid(), getData(), and the mapped Eloquent model rather than on rendered HTML to keep tests resilient. Feature tests through Laravel's HTTP layer still cover CSRF, validation errors, and old-input round trips.
- Is laravel-form-bridge safe to use in production at version 0.7.x?
- It is pre-1.0, so there is no SemVer stability guarantee and patch releases can touch public surface area. Version 0.7.5 added an array return type to getSubscribedEvents(), a no-op for normal consumers but a fatal error for applications overriding that method without the type. Pin the version in your lockfile, grep for getSubscribedEvents overrides before upgrading, and name an owner for framework and Symfony major upgrades.
- Can I use laravel-form-bridge with Livewire, Inertia, or an API-only backend?
- It fits those stacks poorly because the package's value comes from a declarative, server-rendered form definition. With Livewire, Inertia, or API-first front ends the form object is not the primary render path and the abstraction's payoff largely evaporates. If you only need request validation and JSON responses, Laravel FormRequest classes plus Blade components are usually the simpler choice.
- Who maintains laravel-form-bridge and what happens if it is abandoned?
- Releases are authored by the primary maintainer plus an automation bot, so single-maintainer concentration rather than code quality is the dominant long-term risk, and ecosystem signal is thin with around 160 stars and few recorded dependents. Mitigating factors are that the codebase is small enough for a fork to be roughly a day of work and the package imposes no application architecture. Decide on an internal owner and an upgrade SLA, and confirm the symfony/form major is watched in your dependency review process.