PHPackages                             data33/laravel-poll - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. data33/laravel-poll

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

data33/laravel-poll
===================

A Laravel 5 package for creating, managing and interacting with polls

1.0.1(6y ago)1461MITPHPPHP &gt;=7.1

Since Jul 10Pushed 6y ago2 watchersCompare

[ Source](https://github.com/Data33/laravel-poll)[ Packagist](https://packagist.org/packages/data33/laravel-poll)[ Docs](https://github.com/Data33/laravel-poll)[ RSS](/packages/data33-laravel-poll/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Data33/Laravel-Poll
===================

[](#data33laravel-poll)

A package for managing polls in Laravel.

Installation
------------

[](#installation)

Open your `composer.json` file and add the following to the `require` key:

```
"data33/laravel-poll": "^1.0.1"

```

---

After adding the key, run composer update from the command line to install the package

```
composer update data33/laravel-poll
```

Configuration
-------------

[](#configuration)

Before you can start using the package we need to set some configurations. To do so you must first publish the config file, you can do this with the following `artisan` command.

```
php artisan vendor:publish --provider="Data33\LaravelPoll\PollServiceProvider"
```

After running the above command, you should see the following changes:

- A config file should be available at `config/polls.php`
- A few new migrations should be placed in your `database/migrations` folder
- A few new views should be placed in the folder `resources/views/vendor/data33/laravel-poll`

If you wish to extend this package, you can specify your own classes to be used as models in the ` config/polls.php` file. Make sure your models extend the existing ones.

Usage
-----

[](#usage)

### Creating a new poll

[](#creating-a-new-poll)

You can either create polls manually by using the models directly, or you can use the createPoll helper method.

```
use Data33\LaravelPoll\Models\Poll;

$title = 'A new poll';
$text = 'A longer text describing the poll';
$type = Poll::TYPE_SINGLE;
// $type = Poll::TYPE_MULTIPLE;
$options = [
    'The first option',
    'The second option',
    'The third option',
];
$endDate = new Carbon\Carbon('2018-12-24 00:00:00');

$poll = Poll::createPoll($title, $text, $type, $options, $endDate);
```

### Adding more options

[](#adding-more-options)

If you need to add more options to a poll after it has already been created you may use the addOption method.

```
    $poll->addOption('A fourth option')
        ->addOption('A fifth option');
```

### Voting for an option

[](#voting-for-an-option)

Let's assume your App\\User model uses the Voter trait.

```
    auth()->user()
        ->voteFor($poll, $pollOption);
```

### Checking voting status for a voter

[](#checking-voting-status-for-a-voter)

```
    if (auth()->user()->hasVotedInPoll($poll)) {
        echo 'User voted in poll';
    }

    if (auth()->user()->hasVotedForOption($poll, $option)) {
        echo 'User voted for specific option';
    }
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~551 days

Total

2

Last Release

2314d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a99e14e2db1cc9e5c119d2e48752b300e3b13602231f375e411b5682f533ea41?d=identicon)[Data33](/maintainers/Data33)

---

Top Contributors

[![Data33](https://avatars.githubusercontent.com/u/195278?v=4)](https://github.com/Data33 "Data33 (7 commits)")

---

Tags

laravelpolls

### Embed Badge

![Health badge](/badges/data33-laravel-poll/health.svg)

```
[![Health](https://phpackages.com/badges/data33-laravel-poll/health.svg)](https://phpackages.com/packages/data33-laravel-poll)
```

###  Alternatives

[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[nickurt/laravel-akismet

Akismet for Laravel 11.x/12.x/13.x

97139.6k2](/packages/nickurt-laravel-akismet)[whitecube/laravel-timezones

Store UTC dates in the database and work with custom timezones in the application.

106106.2k](/packages/whitecube-laravel-timezones)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[forxer/laravel-gravatar

A library providing easy gravatar integration in a Laravel project.

4235.6k](/packages/forxer-laravel-gravatar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
