napas/form-extra-bundle
A Symfony bundle that extends Symfony Forms with additional form types, helpers, and practical utilities, making it easier to build richer, reusable forms with less boilerplate and integrate smoothly into existing Symfony applications.
Reality check first: this is a Symfony bundle, not a Laravel package. It ships a Symfony Bundle class, form types extending Symfony\Component\Form\AbstractType, and Twig form themes. That means you cannot composer require napas/form-extra-bundle in a Laravel app and expect anything to happen — there is no service provider, no config publish tag, and nothing registers with Laravel's container.
What you can do is treat it as a source of reference implementations to port. For a Laravel developer the realistic entry points are:
Form/Type/ — the actual field types (this is the payload you care about)Form/DataTransformer/ — model↔view transformationsResources/views/Form/ — Twig form theme blocks (the markup you'd translate to Blade)DependencyInjection/ and NapasFormExtraBundle.php — registration, which you will ignorecomposer require napas/form-extra-bundle and register in AppKernel::registerBundles(). Pin the constraint aggressively — the last tagged release is from June 2014, so expect Symfony 2.3–2.8 territory and PHP 5.x.FormRequest.If you only need one field's behavior, porting 50–100 lines into a Blade component is almost always cheaper than dragging the Symfony Form component into Laravel.
Pattern 1 — Port the form type to a Blade component + FormRequest (recommended).
The Symfony type class is usually just: default options, a buildView that sets vars, and optionally a data transformer. In Laravel:
data array.buildView vars into the component's public properties.resources/views/components/...blade.php.FormRequest rule or a custom Rule object.cast on the model or an Attribute accessor/mutator.Pattern 2 — Livewire for the interactive behavior.
If the type does dependent selects, autocomplete, or client-side masking, the Symfony version relies on a JS asset in Resources/public/. In Laravel, reimplement the interaction in a Livewire component with wire:model and updatedFoo() hooks — this gets you server-side reactivity without hand-rolling the JS the bundle shipped in 2014.
Pattern 3 — Symfony Form component standalone (only if the type logic is genuinely complex).
You can composer require symfony/form in Laravel and use FormFactory manually. It works, but you inherit the Twig renderer dependency, the translator contract, and a large config surface for what is usually a one-field problem. Reserve this for cases where you're porting many interdependent types at once, and wrap it in a service so the rest of the app never sees Symfony types.
Pattern 4 — Legacy Symfony coexistence. If the app is Symfony and you're migrating toward Laravel incrementally, use the bundle as-is on the Symfony side and mirror the field contract (name, options array shape) on the Laravel side. Keeping option keys identical makes the eventual cutover a validation exercise rather than a rewrite.
Integration tips:
composer.json you intend to maintain.AbstractType with setDefaultOptions()/getName() rather than configureOptions()/getBlockPrefix(). Those methods were removed in Symfony 3, so even in a modern Symfony app the classes won't instantiate without shimming.form_div_layout.html.twig block inheritance has no Blade equivalent. You'll rewrite the block rather than convert it; budget accordingly.Resources/public/ was written for Assetic or pre-webpack Symfony. Assume the JS is jQuery-era and rewrite it rather than shim it.$options['translation_domain'] or use trans-style labels. Missing translation keys fail silently in Symfony and will fail more loudly in Laravel — grep for translation_domain and ->trans( before porting.ModelTransformer/ViewTransformer pairs encode the interesting domain logic. Port these first and port them faithfully; the markup is the easy part.{{ form_widget(form.field) }} producing nothing usually means the block prefix doesn't match a theme block. Check getBlockPrefix() and confirm the bundle's Twig path is registered under twig.form.resources in config.FormExtension with FormTypeExtensionInterface, that pattern maps cleanly to a Blade component's shouldRender() / slot logic — it's the most portable idea in the repo.How can I help you explore Laravel packages today?