imatic/form-bundle
Imatic Form Bundle is a PHP package for building and managing forms with reusable components, flexible configuration, and straightforward validation, helping developers create consistent form workflows and speed up application development.
imatic/form-bundle is a Symfony bundle, not a Laravel package. Its code is built around Symfony\Component\Form, Bundle subclasses, DI extensions, and service tags like form.type / form.type_extension. If your app is Laravel, the correct first step is to not require it — there is no service container, bundle registration, or Form component for it to plug into. Read the source as a design reference instead (see Implementation Patterns).composer require imatic/form-bundle, then register it in config/bundles.php:
Imatic\FormBundle\ImaticFormBundle::class => ['all' => true],
Do not assume the class name or namespace. Confirm both against composer.json (autoload.psr-4) and src/*Bundle.php — a mismatch here is the most common first-run failure.composer.json (the symfony/form and PHP constraints decide whether this is even viable), src/DependencyInjection/Configuration.php and the extension class (the only real configuration surface), src/Form/ (types, extensions, data transformers), then src/Resources/ (Twig themes, translations, routes). With a package this small, the source is the documentation.TextType and a DateType, render it, then enable the bundle and render again. Run bin/console debug:form and bin/console debug:container --tag=form.type to see exactly which types and extensions the bundle registers. That single experiment tells you what the bundle actually does faster than any README.src/Form/ and ask of each class: "what Laravel primitive replaces this?" Custom types usually map to Blade components or FormRequest fields; type extensions map to shared validation rules or a base request class; Twig helpers map to Blade components. Spike one form end-to-end natively before deciding you need anything from the bundle at all.FormTypeExtensionInterface implementations, they attach to every instance of a field type automatically. Consume them through per-field options declared in configureOptions rather than creating parallel form types — subclasses multiply the surface you must retest on every Symfony upgrade.->add('field', MyType::class, [...]) exactly as you would a core type. Do not add factory wrappers or a second registration layer on top.createForm(), handleRequest(), isValid(), $form->getData() should remain untouched. If the bundle exposes helpers, treat them as thin conveniences; anything that replaces the standard submit/validate flow is coupling you will pay for later.# config/packages/twig.yaml
twig:
form_themes: ['@ImaticForm/form_layout.html.twig']
Override individual blocks in your own theme file and point form_themes at yours — never edit vendor templates.config/routes.yaml if any AJAX/validation endpoints ship with the bundle, and reference them by name from your frontend rather than hardcoding paths.FormRequest per operation for validation and authorization, custom Rule objects for reusable constraints, spatie/laravel-data if you want typed DTOs, and Blade components or Livewire for dynamic/repeating fields. This gives you the same ergonomics the bundle aims at, on a first-party, documented, upgrade-safe stack.composer.json, and record provenance plus the MIT attribution. That fixture suite is your only upgrade safety net.composer.json first. Check the symfony/form range, the PHP floor, and the last tagged release. Low-usage bundles like this one are frequently pinned to Symfony 2.x/3.x; form types, options resolvers, and event names have shifted since, so loading it on Symfony 6/7 may fail at boot or, worse, at submit time.services.yaml. bin/console debug:container 'Imatic' confirms whether services actually exist in the container; if they don't, the bundle is registered but inert.debug:form, debug:container --tag=form.type_extension, debug:twig, and the Form panel in the Web Profiler. Most "the bundle isn't working" reports resolve to a theme not registered or an extension not tagged.Validator and FormRequest gives you two sources of truth for rules, messages, and error bags. Pick the native one; the bundle has no compensating capability to justify the split.config/packages/imatic_form.yaml (confirm the exact key from Configuration.php), and if you need behavior changes, fork to an internal namespace where you can actually test them.How can I help you explore Laravel packages today?