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

Liform Laravel Package

rogerdsh/liform

Liform is a lightweight form-building package for Laravel. Define forms in PHP, render them in Blade, and handle validation with minimal boilerplate—keeping markup consistent and controllers clean. A simple fit for admin panels and small apps.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Liform occupies a narrow but useful niche: it walks a Symfony Form's type tree and emits a JSON Schema document describing the form's fields, types, and constraints. That makes it a bridge between server-side form definitions and client-side renderers (react-jsonschema-form, Formik schema adapters, API documentation generators). The package under evaluation is a fork with no visible adoption: 0 stars, 0 dependents, and a score of 0. It should be treated as source code to be vendored, not a dependency to be trusted.

Architecture fit. Poor out of the box for a typical Laravel application. Laravel's form story is FormRequest + the Validator facade; Symfony Forms is a separate component with its own FormType, FormBuilder, and event system. Adopting Liform means introducing symfony/form into a Laravel codebase and authoring FormType classes as a second source of truth alongside existing validation rules. The fit becomes strong only in two scenarios: (a) the application already uses Symfony Forms (e.g., a legacy component or a Symfony service embedded in a Laravel monolith), or (b) the team deliberately wants a form-definition-as-source-of-truth model where one PHP class generates both validation and the client schema.

Integration feasibility. Mechanically straightforward. It is a plain Composer library — no service provider, no facade, no config file, no published migrations. You composer require it, instantiate the renderer, and pass a built FormInterface. The real work is the adapter layer you will write yourself. Watch the symfony/form version constraint: Laravel ships several Symfony components but not symfony/form, so this will be a net-new transitive dependency. Verify the package's constraint against the Symfony version range your PHP and Laravel versions permit before committing.

Technical risk. High, and mostly non-technical. The failure mode here is not "the code is wrong" — the code is probably fine — it is "nobody is home." Zero dependents means no downstream projects have absorbed breaking changes, no issue tracker has pressure-tested edge cases, and no security advisory feed will notify you of a vulnerability in this package's own code. The library is also likely a fork of the long-standing liform project; if so, the fork's delta from upstream is the single most important thing to understand, because you are inheriting whatever state upstream was left in.

Key questions for the maintainer (or for your own due diligence).

  • What is the diff against the upstream liform project, and why was the fork created?
  • Which symfony/form major versions are supported, and is there a CI matrix proving it?
  • How are custom FormType classes, PRE_SET_DATA/POST_SUBMIT listeners, and dynamic field modification handled — silently dropped, or reflected?
  • How are Symfony validation constraints (Assert\NotBlank, Assert\Length, custom constraints) mapped into JSON Schema keywords?
  • Is there any handling for file uploads, collections of nested forms, or entity-type fields backed by a database query?

Integration Approach

Stack fit. Treat Liform as an internal utility, not a framework citizen. The idiomatic Laravel pattern is a thin service class — something like FormSchemaService — registered in a service provider, that accepts a FormInterface and returns an array or stdClass suitable for response()->json(). Keep the Liform calls isolated so the library can be swapped or replaced without touching controllers.

Migration path. Two viable paths, and the choice should be made explicitly rather than drifted into:

  1. If Symfony Forms already exist, Liform is a near-zero-cost win: add it, generate schemas for existing forms, expose them behind a cached endpoint.
  2. If starting from Laravel-native validation, the migration is expensive and probably not worth it. You would be rewriting FormRequest rules as FormType classes to get schema output, then maintaining both. A more proportionate alternative is generating JSON Schema directly from Laravel rules with a small in-house mapper, or using a maintained schema library such as opis/json-schema for validation and a hand-curated schema file for the client contract. Liform only pays for itself if the form definition is genuinely reused across validation and rendering.

Compatibility. Confirm three things before writing code: the package's supported PHP range versus your deployment target, its symfony/form constraint versus what Composer resolves in your tree, and whether it pulls additional Symfony components that conflict with Laravel's pinned versions. Symfony components are generally backward-compatible within a major, but Laravel pins specific minors in composer.json and conflicts surface at install time, not runtime.

Sequencing.

  1. Timeboxed spike: one representative form, one generated schema, inspected by hand against the expected client contract.
  2. Prove the constraint-mapping story — the schema is only useful if NotBlank becomes required and Length becomes minLength/maxLength.
  3. Build the adapter service and a route that serves the schema; add a contract test that asserts the exact JSON Schema output, so any upstream drift breaks CI loudly.
  4. Cache schemas at the application layer (config cache or a versioned file) — schema generation should not run per request.
  5. Only then expand to the full form inventory.

Operational Impact

Maintenance. Effectively zero external maintenance and correspondingly high internal maintenance. Because there are no dependents, no one else will file the bug report you are about to file, and no one will submit the fix. Plan to vendor the repository into your own organization, pin to a specific commit hash rather than a version constraint, and assign a named owner. Budget perhaps one to two engineer-days per year for dependency bumps, plus the initial integration effort.

Support. There is no support channel. Documentation, if present, is a README written for the author. Onboarding material must be written in-house. The mitigating factor is surface area: the library is small and readable, so a competent PHP engineer can audit the full source in an afternoon — which is exactly what should happen before it reaches production.

Scaling. Runtime cost is negligible. Schema generation is a pure in-memory traversal of the form tree; the operation scales with form complexity, not traffic, provided you cache the output. Storage and serialization costs are trivial. The scaling concern is organizational: as the number of FormType classes grows, so does the implicit coupling between your HTTP validation layer and this library's reflection behavior.

Failure modes, ranked.

  • Silent schema drift — a change to a FormType alters the emitted schema in a way that breaks the frontend renderer. Mitigated by contract tests on the JSON output.
  • Dependency conflict on upgrade — a Laravel or Symfony major bump makes the package uninstallable. Mitigated by the adapter boundary; the fix is a local patch or a fork replacement.
  • Unsupported field types — entity fields, nested collections, or custom types render as an opaque or absent schema fragment. Mitigated by enumerating supported types during the spike.
  • Abandonment — the repository is deleted or goes private. Mitigated by vendoring the source and retaining the MIT license text.
  • Security — low likelihood given the scope (no I/O, no deserialization, no network), but there is no advisory channel to confirm that assessment over time.

Ramp-up. The library itself takes hours to learn. The real cost is the prerequisite: a Laravel team unfamiliar with Symfony Forms must learn FormType, FormBuilder, the form event lifecycle, and the constraint model before the first useful schema can be produced. That is a multi-day investment for engineers who have only worked in Laravel, and it is the dominant line item in any cost estimate for this integration. If the team already knows Symfony Forms, most of this cost disappears and the package becomes a cheap, if slightly risky, accelerator.

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.
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
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle