friendsofvictoire/simplecontactform-widget
A lightweight widget for adding a simple contact form to Laravel/PHP applications. It provides reusable form UI and basic submission handling, keeping contact form integration quick and easy.
Before anything else: this is not a Laravel package. friendsofvictoire/simplecontactform-widget is a Symfony bundle built for Victoire DCMS (a Symfony 2/3-era CMS), last tagged in March 2017, with a single GitHub star and zero dependents. There is no service provider, no facade, no config file Laravel would auto-load, and no Composer extra.laravel block. If you composer require it into a Laravel app you will pull Symfony 2/3 components and a Victoire dependency tree that will not boot. Treat this as a reference implementation to read, not a dependency to install.
If you are working inside an actual Victoire/Symfony project (the only place it runs), the minimal path is:
composer require friendsofvictoire/simplecontactform-widgetVictoire\Widget\SimpleContactFormBundle\VictoireWidgetSimpleContactFormBundle in AppKernel::registerBundles() (Symfony 2/3) or config/bundles.php (if someone has shoehorned it onto Symfony 4).php app/console cache:clear (or bin/console).Where to look first in the source:
Widget/ — the widget entity (typically SimpleContactFormWidget) with the @Widget annotation and getWidgetName(); this is the shape of the stored data.Form/ — the Symfony form type that defines the fields rendered on the front end.Resources/views/ — the Twig template Victoire renders when the widget is dropped on a page.Controller/ — the submit/redirect action that receives the POST.First real use case: drop the widget onto a "Contact" business page template, set the recipient address and subject in the widget's slot fields, then submit the front-end form and confirm the mail lands via your configured swiftmailer transport. That end-to-end loop (widget → form POST → controller → mailer) is what the bundle actually does, and it is the whole bundle.
Widget-as-entity. In Victoire, every widget is a Doctrine entity persisted as part of a page's slot tree. The bundle defines a SimpleContactFormWidget extending Victoire\Bundle\WidgetBundle\Entity\Widget, annotated @Widget. Daily work means: edit the widget in the back office, its fields (recipient, subject, success message, field toggles) are serialized with the page, and the front-end template renders a form from those stored values. Do not expect request-time config from config/; the configuration lives in the CMS content.
Form rendering. The front-end view typically delegates to a Symfony FormType. The pattern you will follow is: read the widget's properties in the Twig template, pass them into the form type as options, render with normal Symfony form helpers. If you need extra fields (phone, company, a hidden honeypot), you do not edit vendor code — you subclass the widget entity, redeclare the @Widget annotation with your own name, and point a template override at it.
Template overrides. Victoire resolves widget templates through the standard Symfony override chain. Place a file at the matching path under app/Resources/VictoireWidgetSimpleContactFormBundle/views/Widget/... (or your app-level templates/ in newer Symfony) and it wins. This is the sanctioned extension point and the only way to restyle without forking.
Submission handling. The POST is handled by the bundle's controller, which validates the Symfony form, sends mail via the mailer, and redirects (usually back to the same page with a flash). For anything beyond "send an email" — persisting leads, hitting a CRM, dispatching an event — the clean pattern is an event listener or a kernel/request subscriber that reacts to the submission rather than patching the controller.
For a Laravel developer, the honest translation. If you are evaluating this to build a contact form in Laravel, the equivalent day-to-day pattern is:
@csrf.FormRequest (ContactRequest) with authorize(), rules(), and a honeypot rule.Mailable + Mail::to(config('mail.contact'))->send(new ContactMail($data)).Route::post('/contact', ...) returning back()->with('status', ...).Livewire component if you want the "drop it on a page" ergonomic the widget gives you in Victoire.The widget's real value is the "content editors place it themselves" workflow; in Laravel that maps to a Blade component with configurable props, not a package.
AppKernel, app/console, Swiftmailer). Composer may resolve but the code will fatal. Do not add this to a Laravel composer.json.swiftmailer/mailer DSN is unset or the transport is null, the form "succeeds" and silently drops mail. Check config.yml mailer settings before debugging the bundle._token (e.g., after a template override that rebuilds the <form> tag by hand) yields a 419-style rejection. Conversely, there is no built-in captcha or rate limiting — add a honeypot field and a rate limiter yourself.Widget/ subpath match exactly. Victoire's naming is bundle-qualified, so SimpleContactForm vs WidgetSimpleContactFormBundle confusion is common.Controller/ and Resources/views/ directories are the spec. Expect no changelog to explain behavior between minor versions.How can I help you explore Laravel packages today?