friendsofvictoire/form-widget
Form widget for Victoire: adds a reusable component for embedding and managing forms inside the Victoire CMS page builder, so editors can place and configure form content directly in their layouts without custom integration work.
Framework reality check first. friendsofvictoire/form-widget is a Symfony bundle (WidgetFormBundle) built for Victoire, a visual page-builder CMS on Symfony. It is not a Laravel package: there is no service provider, no config publish tag, no Blade views, and no Eloquent anything. A Laravel developer should treat this as either (a) something to use only if you are actually running Symfony + Victoire, or (b) a reference implementation for building a "form widget" concept in your own Laravel page/block system. With 0 stars and 0 dependents, assume it is unmaintained and audit the composer constraints before touching it.
Minimal steps (Symfony/Victoire host app):
composer require friendsofvictoire/form-widget — expect resolution pain; check its symfony/*, doctrine/*, and PHP requirements against your app before committing.AppKernel::registerBundles() on Symfony 2/3-era apps, or config/bundles.php on newer ones. Victoire itself must already be installed and booting.doctrine:schema:update --force or generate a migration — prefer the migration).bin/console cache:clear and bin/console assets:install --symlink (Symfony 3 style) so widget assets are reachable.Where to look first in the repo:
Widget/ (or Entity/) — the widget entity extending Victoire's base Widget; this is where per-widget configuration lives.Form/ — the Symfony Form type(s) that turn widget configuration into rendered fields and handle submission.Resources/views/ — Twig templates for the widget itself and the form theme.Resources/config/ (or DependencyInjection/) — service wiring, widget registration, and any tagged services Victoire discovers.First real use case: a contact/quote form that an editor drops onto a marketing page without a deploy. Success = editor configures fields in the page builder, visitor submits, submission is persisted and/or emailed, and the widget renders consistently inside Victoire's slot layout.
Understand the widget contract before writing code. Victoire widgets are Doctrine entities extending a base widget class, paired with a Symfony Form type that edits the widget's own settings, and a Twig template that renders it in a slot. Two shapes are common:
ContactWidget, QuoteWidget. Explicit, easy to template, but every new form is a class + entity + template + migration.For day-to-day work, the second pattern scales better; the first is safer if the bundle only gives you a thin base.
Rendering pattern. Keep the widget template thin: it should output a wrapper, the form open/close, CSRF token, and delegate field rendering to a form theme. Override the bundle template rather than editing vendor code — in modern Symfony, add a twig.paths entry pointing at templates/bundles/WidgetFormBundle/; on legacy apps use app/Resources/WidgetFormBundle/views/.
Submission handling. Treat submission as a normal Symfony form POST:
Swift_Mailer/\Swift_Message calls in the widget — Symfony 4+ apps will need MailerInterface/Email.Integration tips.
widget_id, page slug, locale) so exports and spam triage are possible later.Extension points worth knowing: form type extensions for shared field behavior, event subscribers for post-submit hooks, custom widget templates, and service decoration of the bundle's submission/notification service if one exists. Prefer decoration over forking.
symfony/form, symfony/http-foundation, and Doctrine versions that conflict with Laravel 9–11's illuminate/* constraints. You cannot meaningfully install this in a Laravel app; require it only in a Symfony project, and expect to relax or fork constraints.composer.json and budget for owning the code.schema:update in production, and check for table-name collisions.form_widget without form_start/form_end. Check form_errors(form) and per-field errors explicitly.debug:container --tag=victoire.widget (or the equivalent tag) to confirm registration, debug:router for the submit endpoint, and Twig's dump() in dev.How can I help you explore Laravel packages today?