adamquaile/symfony-fieldset-bundle
Adds a FieldsetType to Symfony Forms so you can group fields with a and custom legend. Define fields via a builder callback or a simple array, keeping form structure tidy and reusable.
symfony/form or a bridge like laravel-symfony-form).collective/html, laravel-formcomponents) lacks fieldset grouping natively. This package could fill a gap by enabling structured multi-field grouping with legends/validation.symfony/form as a dependency and adapt the bundle’s FieldsetType to Laravel’s form builders (e.g., via a custom trait or facade).Form macros or a custom Fieldset class) to avoid Symfony dependencies.<fieldset> tags with legends).symfony/form) or use as inspiration for a Laravel-native solution.FormRequest vs. Symfony’s Constraint) may require custom validation logic.Form::macro, Livewire components) suffice?symfony/form as a dependency, or must this be Laravel-native?laravel-fieldset) instead?AppKernel.php registration. Use as-is with minimal changes.symfony/form and symfony/form-bundle to composer.json.FieldsetType to form builders.Fieldset class extending Laravel’s Form or using Form::macro.Form::macro('fieldset', function ($name, $legend, $fields) {
return collect($fields)->map(fn ($field) => Form::{$field['type']}($field['name'], $field['options'] ?? []))
->wrap('<fieldset><legend>' . e($legend) . '</legend>', '</fieldset>');
});
Livewire panels, custom Blade components).<fieldset> tags).symfony/form compatibility (test with Laravel’s Symfony bridge if available).@fieldset directive or manual HTML wrapping).symfony/form and adamquaile/symfony-fieldset-bundle to composer.json.Laravel\SymfonyBridge\BridgeServiceProvider).fieldset() method (Option B) or expose Symfony’s FieldsetType (Option A).@fieldset('legend', $fields)).Validator::make()->sometimes()).symfony/form updated alongside Laravel.symfony/form, but bundle-specific bugs are self-reliant.| Risk | Mitigation Strategy |
|---|---|
| Package abandonment | Fork and maintain; or switch to a Laravel-native solution. |
| Symfony dependency conflicts | Use Option B or isolate Symfony components in a microservice. |
| Template rendering issues | Create reusable Blade components for fieldsets. |
| Validation edge cases | Test with nested data structures; use Laravel’s Validator for complex rules. |
| CSRF/session incompatibilities | Ensure Symfony’s CSRF tokens work with Laravel’s middleware (e.g., VerifyCsrfToken). |
Form::macro in Laravel).Recommendation: For Laravel projects, prioritize Option B (native implementation) unless
How can I help you explore Laravel packages today?