Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Simplecontactform Widget Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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:

  1. composer require friendsofvictoire/simplecontactform-widget
  2. Register Victoire\Widget\SimpleContactFormBundle\VictoireWidgetSimpleContactFormBundle in AppKernel::registerBundles() (Symfony 2/3) or config/bundles.php (if someone has shoehorned it onto Symfony 4).
  3. Clear cache: php app/console cache:clear (or bin/console).
  4. Open a page in the Victoire back office, click Add widget, and pick Simple Contact Form from the widget picker.

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.

Implementation Patterns

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:

  • A Blade partial for the form with @csrf.
  • A FormRequest (ContactRequest) with authorize(), rules(), and a honeypot rule.
  • A Mailable + Mail::to(config('mail.contact'))->send(new ContactMail($data)).
  • A Route::post('/contact', ...) returning back()->with('status', ...).
  • Optional: a 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.

Gotchas and Tips

  • It will not run in Laravel. No service provider, no Laravel version constraints, Symfony 2/3 internals (AppKernel, app/console, Swiftmailer). Composer may resolve but the code will fatal. Do not add this to a Laravel composer.json.
  • Effectively abandoned. Last release 2017-03-14, one star, zero dependents. No security patches, no PHP 8 support, no Symfony 5/6 support. Swiftmailer (the mail path this era of bundle assumes) is itself end-of-life. Audit before trusting it anywhere.
  • Mail transport is the usual first failure. The controller sends through the configured mailer; if 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.
  • CSRF and spam. The form type almost certainly includes Symfony's CSRF token; a missing _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.
  • Template override path is the classic debugging trap. If your override is not picked up, dump the resolved template with the Twig profiler and confirm the bundle name and Widget/ subpath match exactly. Victoire's naming is bundle-qualified, so SimpleContactForm vs WidgetSimpleContactFormBundle confusion is common.
  • No tests, no docs in the repo. Read the source directly; the Controller/ and Resources/views/ directories are the spec. Expect no changelog to explain behavior between minor versions.
  • Extension points to prefer are: subclassing the widget entity for new fields, event listeners for post-submission side effects, and template overrides for markup. Avoid editing vendor code, since there is no upgrade path you would want to merge against anyway.
  • If the goal is a contact form in Laravel, skip the port and write ~40 lines: FormRequest + Mailable + Blade partial + rate limiter. You will get more in an afternoon than this bundle offers after a week of wrestling with a 2017 Symfony stack.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator