wemxo/dynamic-form-bundle
Dynamic Form Bundle is a PHP package for building configurable, data-driven forms with reusable fields and validation. Define forms dynamically and adapt fields without rewriting form classes, making it useful for admin panels, CRUD workflows, and custom data entry.
Treat this as a library you borrow from, not a bundle you install. It targets Symfony's Form component (symfony/form), and the *Bundle class plus DI extension only do anything inside a Symfony kernel — inside Laravel they are dead weight. The realistic first step is:
composer require symfony/form symfony/validator wemxo/dynamic-form-bundle
Then read, in this order:
composer.json — the Symfony version constraint tells you which symfony/form major you must hold. This is the single biggest compatibility risk; a 2025 release date does not mean it tracks Symfony 7.src/ — find the class that takes a config array and produces a FormType/FormBuilder. That one class is the whole package for your purposes; everything else is wiring.tests/ and the README example config — they are the only reliable documentation at 10 stars.DependencyInjection/*Extension.php) — useful as a map of which services the factory needs injected.First use case: a per-tenant or per-entity schema stored as JSON (field name, type, options, constraints), passed to the factory at request time to build a form, submitted, validated, and persisted. Get that loop working in a plain artisan command or a single controller before touching Blade rendering or Eloquent.
ValidatorInterface, FormFactoryInterface, event dispatcher). You are doing the container's job that Symfony's extension would normally do — copy the argument list from the extension class.handleRequest() needs a RequestStack and expects Symfony's request shape. In Laravel, call $form->submit($request->all(), 'PATCH' === $request->method()) and handle $form->isValid() yourself. This is actually cleaner than the Symfony path and worth standardising on.createView() requires a form renderer (Twig-backed). If you do not want the Twig bridge, iterate $form->all() and render each child's name, type, and options into your own Blade partial. You lose form themes but keep full control of markup.NotBlank/Length/Regex from the config into a Laravel Validator rule array is usually less work than wiring symfony/validator into Laravel's error bag, and it keeps error messages in one place.register()/boot() for the bundle, no config/packages/*.yaml. If a README step says "enable the bundle", skip it.createView() will throw without a renderer. Plan for manual rendering or pull symfony/twig-bridge deliberately — do not discover this at render time.csrf_protection => false) and rely on Laravel's VerifyCsrfToken middleware; otherwise you get silent invalid-submit failures.type value can be used to instantiate arbitrary form type classes. Whitelist allowed types before handing the config to the factory.[a-z_][a-z0-9_]* pattern at config-write time, not at build time.composer.json, read src/ end to end before trusting it, and be prepared to vendor the ~few hundred lines that matter. If the API surface you actually use is one factory method, copying it into app/Support/ is a legitimate move and removes the dependency risk entirely.DynamicFormBuilder service. Do not patch vendor code — you will not get upgrades, and there are not going to be many.$form->getExtraData() — it usually means your field names in config do not match the request keys (dot notation vs. nesting for compound fields).How can I help you explore Laravel packages today?