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
Laravel Poll

Laravel Poll Laravel Package

jeroennoten/laravel-poll

Laravel Poll is a package by Jeroen Noten that adds simple, database-backed polls to your Laravel app. Create polls with multiple options, let users cast votes, prevent duplicate voting, and display live results using ready-made models and helpers. Easy to install and configure.

View on GitHub
Deep Wiki
Context7

Laravel Poll

Frequently asked questions about Laravel Poll
How do I install jeroennoten/laravel-poll in a Laravel app?
Install the package with Composer using composer require jeroennoten/laravel-poll. Laravel package auto-discovery should register the service provider, but check the README for any required publishing or migration steps. Run the package migrations after installation so the poll, option, and vote tables exist. Review the configuration file if the package exposes one, then start creating polls through the provided models and helpers.
Does laravel-poll prevent users from voting more than once?
Yes, jeroennoten/laravel-poll is designed to prevent duplicate voting. The package tracks votes in the database and uses voter identity rules to block repeat submissions. How voters are identified depends on the package configuration, so review the README for authenticated-user and guest-voting behavior. You should test duplicate prevention against your own authentication setup before relying on it in production.
How do I create a poll with multiple options using laravel-poll?
Use the package models and helpers to create a poll record and attach multiple option records to it. The package is database-backed, so poll and option data are stored through normal Eloquent-style models. The exact method names and relationships are documented in the README, so follow that API rather than assuming a custom schema. After creation, users can cast votes against the poll options.
Can I display live poll results in Laravel Blade views?
Yes, laravel-poll provides ready-made models and helpers for retrieving poll results, which you can pass to Blade views and render as counts or percentages. Live here means current database-backed results, not necessarily real-time broadcasting over WebSockets. For instant updates without refreshing, combine the package results with polling via JavaScript or a broadcasting layer. Always escape poll option text in Blade to avoid cross-site scripting issues.
Which Laravel versions does jeroennoten/laravel-poll support?
Check the package composer.json and README for the exact Laravel and PHP version constraints before installing. Laravel package compatibility can change between releases, so do not assume support for every Laravel version. If you are on an older or very new Laravel release, verify compatibility in a staging branch first. Composer will normally block installation when your framework version does not satisfy the package constraints.
How does laravel-poll identify voters for duplicate prevention?
Voter identification is handled by the package configuration and may use the authenticated user, session data, or another identifier. Review the README and any published config file to see which strategy applies to your installation. For guest polls, make sure the chosen identifier is stable enough to prevent easy repeat voting. You can usually adapt the voter identification logic in your application if the default behavior does not fit your use case.
Is jeroennoten/laravel-poll suitable for production Laravel applications?
It can be suitable for straightforward database-backed polls, especially when you want to avoid an external polling service. Run the migrations, review indexes on vote and option tables, and test duplicate-vote prevention under realistic traffic. Because poll voting can involve concurrent writes, consider database constraints or transactions for high-traffic polls. Also review the repository activity and pin a known-good Composer version before deploying.
How do I test polls and votes in a Laravel test suite?
Use Laravel's database testing tools, such as RefreshDatabase, to migrate the poll tables for each test. Create polls and options through the package models or helpers, then simulate votes as an authenticated user or guest depending on your setup. Assert that vote records are stored correctly and that duplicate votes are rejected. If the package does not provide factories, create test data directly with the models or insert statements.
What are alternatives to laravel-poll for adding polls to Laravel?
You can build a custom poll feature with Eloquent models for polls, options, and votes, which gives you full control over schema and voter rules. Other Laravel poll packages or external polling services may offer richer features such as real-time charts or embeddable widgets. Choose jeroennoten/laravel-poll when you want a simple database-backed implementation with ready-made models and helpers. Evaluate maintenance status and feature fit before committing to any package.
Is jeroennoten/laravel-poll actively maintained?
Check the GitHub repository for recent commits, releases, and issue activity before adopting the package. Composer metadata and the README are the best sources for supported Laravel versions and upgrade notes. If the package is not actively maintained, pin a stable version and be prepared to fork or replace it later. For critical production use, review the code and test it against your Laravel version.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource