rezozero/liform-bundle
Symfony bundle that converts Symfony form definitions into JSON Schema, letting front-end apps render forms from a single source of truth. LiFormBundle serializes form types, fields and options into portable JSON, keeping server-side and client-side forms in sync.
liform/liform library (Symfony Form → JSON Schema), which hard-depends on symfony/form. There is no Laravel applicability as packaged — the bundle layer is Symfony kernel glue (DI definitions, bundle class, Twig helper) with no analogue in a Laravel app. Treat "adopt this package" as "decide whether a Symfony-Form-derived JSON Schema contract is worth standing up Symfony's Form component inside our stack."required, enum, minLength, pattern, numeric bounds) let the frontend run compatible client-side validation and cut round-trips. Caveat for any roadmap built on this: the emitted schema is permissive relative to actual server validation — Validator constraints that liform doesn't map simply don't appear, so the client will accept input the server rejects. Any "reduce invalid submissions" business case must be scoped to the covered subset only.Consider it when:
Look elsewhere (or build a converter) when:
opis/json-schema, is cheaper and avoids two form abstractions and two upgrade cadences in one deployable.EntityType/ChoiceType with query builders, PRE_SET_DATA/PRE_SUBMIT listeners, collection prototypes, or data transformers — these have no faithful schema representation, and transformers mean the schema describes the transformed shape, not the submitted payload.if/then, $defs). If the chosen renderer needs those keywords, that alone can kill it.Sequencing rule regardless of path: keep it off the critical path. Run it as a parallel spike behind an interface (FormSchemaGenerator::for(string $formKey): array) so it is swappable at one seam, and gate broader rollout on a <80% constraint coverage for real forms = abandon threshold plus frontend sign-off that the schema is sufficient to render, including error states (JSON Schema carries no server-side validation messages).
For executives: This is a small MIT-licensed Symfony utility that converts existing server-side form definitions into JSON Schema — the format modern frontend form renderers and API documentation tools already consume. The concept is sound: one canonical form definition producing both server validation and a client-consumable schema, which would reduce duplication and improve API doc accuracy. Three facts should govern the decision. First, it is Symfony-only and does not fit our Laravel stack — adopting it means installing Symfony's Form component as a subsystem inside Laravel for a serialization feature. Second, adoption signals are effectively zero (0 stars, 0 dependents, agency-published wrapper around another library) — no CVE triage, no community corpus, no guaranteed PHP 8.3+/Symfony 7 release, so we would fork or vendor it and own it. Third, the value is entirely contingent on a schema-driven frontend that may not exist; without a committed consumer, the schema is a nice-to-have. Recommendation: do not adopt as a dependency. Fund a timeboxed spike (1–2 weeks, throwaway) to prove the pattern against 3–5 representative forms and measure real constraint coverage. Kill it if coverage is under 80%; otherwise the durable answer is a small internal Laravel-native converter or an OpenAPI-first contract — either way, keep the whole capability behind one interface so it is swappable.
For engineering: The bundle is thin serializer glue; ignore it and evaluate liform/liform + symfony/form directly. Realistic shape of the work: register a Symfony Form factory manually as a Laravel singleton (do not boot the bundle or a kernel), define a fixed catalogue of plain form types, expose GET /api/schemas/{formKey} with HTTP caching and a schema version field, and add golden-file contract tests per form as the regression net against a dependency we don't control. Expect the abstraction to leak silently wherever runtime state is involved — dynamic choice types, event listeners, data transformers, and unmapped Validator constraints. Ongoing cost is 0.1–0.2 FTE for patching and drift, spiking on any PHP major upgrade, plus a knowledge-concentration hazard: one engineer will understand the Symfony-Form-to-schema translation, and that module becomes a black box when they leave. Pin exact versions, commit the lockfile, and pre-decide whether a fork is acceptable — if it isn't, don't start.
How can I help you explore Laravel packages today?