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

Poll Widget Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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):

  1. Require the bundle:
    composer require friendsofvictoire/poll-widget
    
  2. Register it in app/AppKernel.php:
    new FriendsOfVictoire\Widget\PollBundle\WidgetPollBundle(),
    
  3. Ensure the Victoire widget bundle and its assets are installed and dumped:
    php app/console assets:install --symlink
    php app/console cache:clear
    
  4. Open a page in the Victoire editor, insert the Poll widget, fill in the question and options, and save.

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.

Implementation Patterns

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:

  • add your own route + controller for submissions,
  • add a WidgetPollVote entity (poll id, choice id, timestamp, optional IP/session hash),
  • compute aggregates in the controller or a repository method and pass them into the template.

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.

Gotchas and Tips

  • Abandoned and unmaintained. One star, zero dependents, last release 2016-10-07. No security advisories will be issued. Do not put this on a production surface you cannot patch yourself.
  • Symfony-only. It will not install into a Laravel app. There is no illuminate/support dependency and no auto-discovery. Attempting composer require in a Laravel project will fail on Symfony/Victoire constraints.
  • Version conflicts. Before trying anything, run:
    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.
  • Doctrine mapping drift. XML mappings and old annotation syntax can break under newer ORM versions. If you must run it, pin Doctrine alongside Symfony.
  • Victoire version coupling. Widget discovery and template resolution depend on the Victoire widget bundle version. Pin Victoire to a compatible tag; mismatched majors will silently drop the widget from the editor.
  • Assets. Symfony 2/3-era bundles expect assets:install (and often Assetic). Missing CSS/JS in the editor usually means assets were not published — not a code bug.
  • Cache. After overriding the template or changing the form type, run cache:clear. Victoire also caches page composition; stale widget output is almost always cache, not logic.
  • Translations. Look in Resources/translations/ for the message domain used by labels. Copy keys into your app's translations rather than editing vendor files.
  • Extension points. The clean levers are: subclass the widget class, decorate the form type as a Symfony service, and override the Twig template. Avoid forking the bundle unless you are prepared to own it indefinitely.
  • Debugging. If the widget does not appear in the editor, check (in order) bundle registration in 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.
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.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package