- Can I use limenius/liform-bundle in a Laravel application?
- Not directly. It is a Symfony bundle that depends on Symfony Form, DI, and a config tree, so installing it in Laravel would pull in Symfony components that conflict with Laravel's own validator. At most, you could use the framework-agnostic limenius/liform core, or port the schema-generation concept to Laravel FormRequest and Validator rules.
- What does LiformBundle actually do?
- It integrates Liform into Symfony so you can build Symfony Form objects from JSON Schema documents, mapping properties, types, and constraints to form fields and validation. It also supports exposing forms as JSON Schema for JavaScript renderers such as liform-react. It handles nested objects, arrays, enums, and $ref references.
- How do I install and configure limenius/liform-bundle?
- You install it with Composer as a Symfony bundle and register it in the Symfony bundle configuration, then use its config tree for type guessing and custom field mapping. There are no Laravel service provider or config publish steps because the package targets Symfony. For Laravel you would need a separate integration or a custom mapper.
- Which Laravel versions support limenius/liform-bundle?
- None officially. The package targets PHP 8.x and Symfony 5.4 through 7.x, not Laravel. Its PHP floor may align with Laravel 10 or 11, but the Symfony Form dependency is the blocker, so it should be treated as a Symfony-only package.
- How does Liform map JSON Schema constraints to Symfony validation?
- It maps schema constraints such as required, type, min and max, and enums to Symfony form constraints and field types. That translation is tied to Symfony Form internals and constraint classes. Laravel's Validator uses different rule semantics, so there is no direct drop-in mapping.
- Can LiformBundle generate JSON Schema from Laravel FormRequest rules?
- No. Its input contract is Symfony Form objects, not Laravel FormRequest rules. To generate schema from Laravel validation you would need a custom rule-to-schema mapper over Illuminate\Validation\Rule and string rules. That port is feasible, but conditionals and nested arrays require careful handling.
- Is limenius/liform-bundle maintained and production-ready?
- It has a small ecosystem, roughly 141 stars and a near-single maintainer, with a March 2025 release that signals liveness but leaves bus-factor risk. It is best treated as a tactical utility rather than a platform bet. For Laravel teams, production use would add Symfony version-tracking overhead without matching the framework's native validation stack.
- Which JSON Schema draft does Liform output, and does the draft matter?
- Historically the default has been JSON Schema draft-04, while draft-06, draft-07, and 2020-12 differ on exclusiveMinimum, $defs versus definitions, and nullability. Consumers such as renderers or validators pinned to another draft can produce silent contract mismatches. Confirm which draft your consumer supports before committing.
- What are alternatives to LiformBundle for generating JSON Schema in Laravel?
- Options include building a narrow exporter from FormRequest rules, using a hand-authored schema as the source of truth, or porting the Liform concept via a Laravel service provider and rule mapper. A bespoke exporter is often cheaper if you only have a handful of forms and a fixed renderer. The key decision is whether schema generation is a real requirement or still hypothetical.
- How hard is it to port Liform's concept to Laravel?
- A solid v1 covering required, string, integer, numeric, min/max, between, regex, in, nullable, and array.* is roughly 2 to 4 weeks. Cost compounds for required_if, exclude_unless, nested arrays, and cross-field rules, which map poorly to JSON Schema. Start by counting distinct form shapes and how many use conditional or cross-field rules.