friendsofvictoire/poll-widget
A Laravel/PHP package that provides a configurable poll widget for your application. Define poll questions and options, render voting forms, and display results with minimal setup, making it easy to add lightweight polling to Blade views and existing Laravel projects.
This is not a Laravel package. It is a Symfony bundle for Victoire CMS, last released in 2016. There is no service provider, no facade, no config/poll-widget.php. Treat the "Getting Started" steps below as Symfony-side instructions; a Laravel developer will realistically only use this repository as a reference implementation.
Minimal steps (Symfony 2.8/3.x with Victoire installed):
composer require friendsofvictoire/poll-widget
app/AppKernel.php:
new FriendsOfVictoire\Widget\PollBundle\WidgetPollBundle(),
php app/console assets:install --symlink
php app/console cache:clear
Where to look first:
Widget/ (or Widgets/) — the widget class Victoire auto-discovers; this is the integration point.Entity/ — the persisted poll model (and any option/choice entity).Resources/views/ — the Twig template that renders the widget.Form/ — the admin form type defining what editors can configure.First use case: a static poll block on a landing page — question plus selectable options — rendered through Victoire's page composition rather than hand-written Blade/Twig.
Widget registration. Victoire widget bundles use a convention-based widget class extending a Victoire base widget. The class name, alias, and template path are coupled; if you rename one, update the other. Check Resources/config/services.yml (if present) for the tag that wires it into Victoire's widget registry.
Form type configuration. The admin form type is where you actually control the editor experience. Typical shape for a poll:
$builder
->add('question', TextType::class)
->add('choices', CollectionType::class, [
'entry_type' => TextType::class,
'allow_add' => true,
'allow_delete' => true,
'prototype' => true,
]);
If allow_add is not set, editors are limited to a fixed number of options — verify before promising dynamic choices to stakeholders.
Entity and persistence. The widget's entity is Doctrine-mapped. Depending on the era, mappings live under Resources/config/doctrine/*.orm.xml or as annotations. You will inherit the default table names (widget_poll, possibly widget_poll_choice). Do not rename tables without updating the mapping.
Template override. Do not edit the bundle's widget.html.twig directly. Copy it into your app/theme override directory (Victoire resolves widget templates through its theme cascade) and adjust markup there. This keeps the vendor package upgradeable and is the standard Victoire customization path.
Vote storage is the likely gap. A widget bundle of this vintage usually renders a poll but does not ship a complete vote-capture controller, route, or aggregate table. Before scoping a feature, search the repo for Controller/ and any Vote entity. If absent, plan to:
WidgetPollVote entity (poll id, choice id, timestamp, optional IP/session hash),Integration into a page. In Victoire, the widget is dropped into a business template slot. There is no Blade/Livewire equivalent. If you are porting the idea to Laravel, reuse only the domain shape (poll → choices → votes) and reimplement the UI as a Blade partial backed by a controller, or as a Livewire component.
illuminate/support dependency and no auto-discovery. Attempting composer require in a Laravel project will fail on Symfony/Victoire constraints.composer why-not friendsofvictoire/poll-widget
The bundle targets Symfony 2.8/3.x and old PHP. Modern Symfony 5/6/7 projects will not resolve.assets:install (and often Assetic). Missing CSS/JS in the editor usually means assets were not published — not a code bug.cache:clear. Victoire also caches page composition; stale widget output is almost always cache, not logic.Resources/translations/ for the message domain used by labels. Copy keys into your app's translations rather than editing vendor files.AppKernel, the widget service tag, then Victoire's cache. If it appears but renders blank, the Twig override path is wrong or the entity has no choices.How can I help you explore Laravel packages today?