- Can I use simplethings/form-serializer-bundle in a Laravel application?
- Technically you can run composer require, but the bundle is built on the Symfony Form component, Symfony Serializer, and Symfony's event dispatcher and compiler passes. Laravel has no Form component equivalent, so container wiring is service-ID based and would need manual rebinding throughout. Realistically this is a port, not an integration. For a Laravel app, treat it as a design reference only and keep it out of composer.json.
- What does SimpleThings FormSerializerBundle actually do?
- It serializes Symfony form types into JSON, exposing field structure, validation metadata, and options so a JavaScript client can render the form dynamically. The core idea is deriving a (de)serialization schema directly from FormTypeInterface definitions, data mappers, and model transformers. That keeps validation rules and the wire format defined in one place in PHP. There is no equivalent form-type-as-schema abstraction in Laravel.
- Is simplethings/form-serializer-bundle still maintained?
- The package is marked deprecated, and the SimpleThings bundles are Symfony 2/3-era code that has not tracked modern Symfony or PHP releases. With roughly 78 stars and zero dependents, community support is effectively nonexistent. There is no vendor, no SLA, and no security advisory coverage for the transitive dependency tree. Assume you would be owning all fixes yourself.
- Does FormSerializerBundle work with PHP 8.1+ and Symfony 6 or 7?
- Assume incompatibility until proven otherwise. The bundle's PHP constraints are likely to conflict with an 8.1+ baseline, and the Form APIs it targets predate Symfony 6 and 7 changes. Before any design work, run composer why-not and a dependency resolution check. Expect breakage around form type APIs, options resolution, and normalizer behaviour.
- What is the Laravel equivalent of serializing a Symfony form to JSON?
- The native Laravel answer is a FormRequest for validation plus an API Resource or JsonResource for output shape. If you want a single declarative definition that carries both rules and transformation, spatie/laravel-data covers DTOs, validation rules, and transformers in one class. Either approach gives you the same field-schema-as-contract idea without a cross-framework bridge. Port one representative resource as a spike and compare the contract surface.
- How do I install FormSerializerBundle in a Symfony project?
- It is a Symfony bundle, so installation is a Composer require plus bundle registration in the kernel, and it pulls in symfony/form, symfony/serializer, and symfony/event-dispatcher. Its services and compiler passes are registered through the Symfony container. Because the package is deprecated, pin exact versions and freeze your Form type definitions immediately after install.
- How does the bundle expose validation metadata to the frontend?
- It derives field structure and validation metadata from the Symfony Form type definitions, including constraints and options resolved through OptionsResolver. That metadata is emitted alongside the field tree in the JSON payload so client-side renderers can apply required flags, types, and constraints. Because everything comes from the form definition, changing a form type silently changes the API contract.
- What are the risks of using form definitions as the API contract?
- The biggest risk is silent schema drift: because the form type is the contract, editing a form type changes the wire format with no separate review surface. Reviewers see a PHP form change, not an API breaking change. Pair any implementation of this pattern with explicit contract tests or a generated schema snapshot that fails CI when the shape moves.
- Should I fork FormSerializerBundle and maintain it internally?
- Only if a Symfony service already owns this serialization and you cannot extract it. Forking means budgeting recurring effort for PHP and Symfony version bumps, transitive CVE patching, and API drift review, which is an ongoing line item rather than a one-off integration cost. Issue triage and reproduction become entirely internal with no upstream to lean on. A cleaner option is wrapping serialization behind an application-level Serializer interface so the bundle can eventually be swapped.
- How should a Laravel team integrate with an existing Symfony form-serializer service?
- Keep the bundle where it already runs and expose the result over HTTP rather than loading it in-process inside Laravel. Define an internal DTO or Serializer contract on the Laravel side that is independent of both frameworks, then consume the Symfony endpoint behind that contract. This preserves the existing investment while leaving the Laravel codebase free to standardize on laravel-data or FormRequest plus Resources.