PHPackages                             caresome/filament-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. caresome/filament-poll

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

caresome/filament-poll
======================

A FilamentPHP plugin for creating and managing polls

v2.0.0(3mo ago)10130↑650%3MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Oct 25Pushed 3mo agoCompare

[ Source](https://github.com/caresome/filament-poll)[ Packagist](https://packagist.org/packages/caresome/filament-poll)[ Docs](https://github.com/caresome/filament-poll)[ RSS](/packages/caresome-filament-poll/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (14)Versions (5)Used By (0)

Filament Poll
=============

[](#filament-poll)

A FilamentPHP v5 plugin for creating and managing interactive polls with Livewire-powered components.

[![filament-poll-thumbnail](https://private-user-images.githubusercontent.com/210097147/505556015-e2ba0ff6-1ca9-4a4a-99e9-5835c066e1ce.webp?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQzMzEwMzEsIm5iZiI6MTc3NDMzMDczMSwicGF0aCI6Ii8yMTAwOTcxNDcvNTA1NTU2MDE1LWUyYmEwZmY2LTFjYTktNGE0YS05OWU5LTU4MzVjMDY2ZTFjZS53ZWJwP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDMyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAzMjRUMDUzODUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmEyNWRhODUwYWNjMzVkOWI3MjZhMjVjOGNlMDU4YmU5YTYzNGU3ZDJkNjVjMmU5NzdlM2RmMTBhNTlkZmU5YiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.8UVEf_i1j5HrSGzRiX4xCOnuSanP_0yu-kpVmhW8oFI)](https://private-user-images.githubusercontent.com/210097147/505556015-e2ba0ff6-1ca9-4a4a-99e9-5835c066e1ce.webp?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQzMzEwMzEsIm5iZiI6MTc3NDMzMDczMSwicGF0aCI6Ii8yMTAwOTcxNDcvNTA1NTU2MDE1LWUyYmEwZmY2LTFjYTktNGE0YS05OWU5LTU4MzVjMDY2ZTFjZS53ZWJwP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDMyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAzMjRUMDUzODUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmEyNWRhODUwYWNjMzVkOWI3MjZhMjVjOGNlMDU4YmU5YTYzNGU3ZDJkNjVjMmU5NzdlM2RmMTBhNTlkZmU5YiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.8UVEf_i1j5HrSGzRiX4xCOnuSanP_0yu-kpVmhW8oFI)

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Quick Start](#quick-start)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Events](#events)
- [Testing](#testing)
- [Security](#security-considerations)
- [Accessibility](#accessibility)
- [License](#license)

Features
--------

[](#features)

- **Easy Management** - Create and manage polls through Filament admin panel
- **Flexible Voting** - Single or multiple choice polls
- **Guest Support** - Optional guest voting with session tracking
- **Real-time Updates** - Live vote counting with configurable polling intervals
- **Rich Display** - Results with percentages and progress bars
- **Scheduled Closing** - Set poll closing dates
- **Interactive UI** - Livewire-powered voting experience
- **Simple Integration** - Blade component for easy frontend use
- **Event System** - Listen to poll lifecycle events
- **Accessible** - WCAG 2.1 AA compliant

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Laravel 11.x or 12.x
- FilamentPHP 5.x

Quick Start
-----------

[](#quick-start)

```
composer require caresome/filament-poll
php artisan vendor:publish --tag="filament-poll-migrations"
php artisan migrate
```

Register the plugin in your panel provider:

```
use Caresome\FilamentPoll\PollPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            PollPlugin::make(),
        ]);
}
```

Display a poll on your frontend:

```

```

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

[](#installation)

### Step 1: Install Package

[](#step-1-install-package)

```
composer require caresome/filament-poll
```

### Step 2: Publish and Run Migrations

[](#step-2-publish-and-run-migrations)

```
php artisan vendor:publish --tag="filament-poll-migrations"
php artisan migrate
```

### Step 3: Optional Publishing

[](#step-3-optional-publishing)

Publish config file (for customizing table names):

```
php artisan vendor:publish --tag="filament-poll-config"
```

Publish views (for customization):

```
php artisan vendor:publish --tag="filament-poll-views"
```

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

[](#configuration)

### Basic Setup

[](#basic-setup)

Add the plugin to your Filament panel provider:

```
use Caresome\FilamentPoll\PollPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            PollPlugin::make(),
        ]);
}
```

### Configuration Options

[](#configuration-options)

The plugin provides chainable methods to customize behavior:

#### Navigation

[](#navigation)

```
PollPlugin::make()
    ->navigationIcon('heroicon-o-chart-bar')
    ->navigationSort(10)
```

MethodDescriptionDefault`navigationIcon()`Set navigation icon`heroicon-o-chart-bar``navigationSort()`Set navigation sort order-#### Poll Defaults

[](#poll-defaults)

```
PollPlugin::make()
    ->isActiveByDefault(true)
    ->allowGuestVotingByDefault(false)
    ->multipleChoiceByDefault(false)
    ->showResultsBeforeVotingByDefault(false)
    ->showVoteCountByDefault(true)
```

MethodDescriptionDefault`isActiveByDefault()`Polls are active by default`true``allowGuestVotingByDefault()`Allow guest voting`false``multipleChoiceByDefault()`Enable multiple choice`false``showResultsBeforeVotingByDefault()`Show results before voting`false``showVoteCountByDefault()`Display vote counts`true`#### Limits &amp; Performance

[](#limits--performance)

```
PollPlugin::make()
    ->maxPollOptions(20)
    ->maxOptionTextLength(255)
    ->pollingInterval('5s')
```

MethodDescriptionDefault`maxPollOptions()`Maximum poll options`20``maxOptionTextLength()`Max characters per option`255``pollingInterval()`Live update interval (null to disable)`5s`#### Authentication

[](#authentication)

```
PollPlugin::make()
    ->authGuard('admin')
```

MethodDescriptionDefault`authGuard()`Set authentication guardAuto-detect from panel`useDefaultAuthGuard()`Use Laravel's default guard-**How it works:**

- Auto-detects the Filament panel's guard
- Falls back to Laravel's default guard
- Supports multi-guard applications

**Example:**

```
PollPlugin::make()
    ->authGuard('admin')
```

### Complete Example

[](#complete-example)

```
use Caresome\FilamentPoll\PollPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            PollPlugin::make()
                ->navigationIcon('heroicon-o-chart-bar')
                ->navigationSort(10)
                ->isActiveByDefault(true)
                ->allowGuestVotingByDefault(false)
                ->multipleChoiceByDefault(false)
                ->showResultsBeforeVotingByDefault(false)
                ->showVoteCountByDefault(true)
                ->maxPollOptions(20)
                ->maxOptionTextLength(255)
                ->pollingInterval('5s')
                ->authGuard('admin'),
        ]);
}
```

### Custom Table Names

[](#custom-table-names)

Publish the config file and modify table names:

```
php artisan vendor:publish --tag="filament-poll-config"
```

```
return [
    'table_names' => [
        'polls' => 'custom_polls',
        'poll_options' => 'custom_poll_options',
        'poll_votes' => 'custom_poll_votes',
    ],
];
```

Usage
-----

[](#usage)

### 1. Create Polls

[](#1-create-polls)

Navigate to the **Polls** resource in your Filament admin panel:

1. Click "New Poll"
2. Enter poll question and options
3. Configure settings (guest voting, multiple choice, etc.)
4. Set closing date (optional)
5. Save and publish

### 2. Display Polls on Frontend

[](#2-display-polls-on-frontend)

#### Using Blade Component (Recommended)

[](#using-blade-component-recommended)

**By Poll ID:**

```

```

**By Poll Model:**

```

```

#### Using Livewire Component

[](#using-livewire-component)

```
@livewire('caresome::filament-poll', ['poll' => $poll])
```

### 3. Passing Polls to Views

[](#3-passing-polls-to-views)

**In your controller:**

```
use Caresome\FilamentPoll\Models\Poll;

public function index()
{
    $poll = Poll::where('is_active', true)->first();

    return view('welcome', compact('poll'));
}
```

**In your view:**

```
@if($poll)

@endif
```

Events
------

[](#events)

The package dispatches lifecycle events for custom integrations.

### Available Events

[](#available-events)

EventWhen FiredProperties`PollCreated`New poll created`$event->poll``PollVoted`Vote is cast`$event->poll`, `$event->vote``PollClosed`Poll closes`$event->poll`### Listening to Events

[](#listening-to-events)

**In EventServiceProvider:**

```
use Caresome\FilamentPoll\Events\{PollCreated, PollVoted, PollClosed};

protected $listen = [
    PollCreated::class => [
        SendPollNotification::class,
    ],
    PollVoted::class => [
        TrackAnalytics::class,
    ],
    PollClosed::class => [
        SendResultsSummary::class,
    ],
];
```

**Using Event::listen():**

```
use Illuminate\Support\Facades\Event;
use Caresome\FilamentPoll\Events\PollVoted;

Event::listen(PollVoted::class, function (PollVoted $event) {
    $poll = $event->poll;
    $vote = $event->vote;

});
```

### Example Use Cases

[](#example-use-cases)

- Send notifications when polls are created
- Track voting analytics
- Trigger webhooks on vote events
- Archive closed polls
- Send result summaries to stakeholders

Security Considerations
-----------------------

[](#security-considerations)

### Overview

[](#overview)

The package implements multiple security layers for vote tracking and prevention of abuse.

### Vote Tracking Methods

[](#vote-tracking-methods)

User TypeTracking MethodDuplicate Prevention**Authenticated**User IDDatabase unique constraint**Guest**Session ID + IP AddressDatabase unique constraint### Security Notes

[](#security-notes)

**Authenticated Users:**

- ✅ One vote per user per poll
- ✅ Database-level enforcement
- ✅ High security

**Guest Voting:**

- ⚠️ Session + IP tracking (reasonable protection)
- ⚠️ Can vote again if cookies cleared
- ⚠️ VPN users share IPs (but unique sessions prevent conflicts)
- 🔒 Disable for high-security polls: `allowGuestVotingByDefault(false)`

### Performance

[](#performance)

The package includes built-in optimizations:

- ✅ Eager loading prevents N+1 queries
- ✅ Database indexes on frequently queried fields
- ✅ Cached vote counting
- ✅ Efficient query constraints

Testing
-------

[](#testing)

### Run Tests

[](#run-tests)

```
composer test
composer test-coverage
```

### Using Factories

[](#using-factories)

The package provides factories for testing:

```
use Caresome\FilamentPoll\Models\{Poll, PollOption, PollVote};

$poll = Poll::factory()->active()->multipleChoice()->create();

$option = PollOption::factory()->forPoll($poll)->create();

$vote = PollVote::factory()->forOption($option)->authenticated(1)->create();
$vote = PollVote::factory()->forOption($option)->guest()->create();
```

### Available Factory States

[](#available-factory-states)

ModelStates**Poll**`active()`, `inactive()`, `closed()`, `open()`, `neverCloses()`, `multipleChoice()`, `singleChoice()`, `allowGuestVoting()`, `requireAuth()`**PollOption**`forPoll($poll)`**PollVote**`forOption($option)`, `authenticated($userId)`, `guest()`Accessibility
-------------

[](#accessibility)

WCAG 2.1 AA compliant with full accessibility support:

FeatureImplementation**ARIA Labels**All interactive elements labeled**Keyboard Navigation**Full keyboard support**Screen Readers**Comprehensive announcements**Focus Management**Visible indicators, logical tab order**Live Regions**Real-time updates announced**Semantic HTML**Proper use of fieldset, legend, etc.**Progress Bars**Accessible with ARIA attributesLicense
-------

[](#license)

The MIT License (MIT). See [LICENSE.md](LICENSE.md) for details.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance80

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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 ~46 days

Total

3

Last Release

104d ago

Major Versions

v1.0.0.x-dev → v2.0.02026-01-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/91b7be9254c93c6a923e5c82c21d0167b36c32ce62c056e2c36a2edf8bbbcc4e?d=identicon)[caresome](/maintainers/caresome)

---

Top Contributors

[![caresome](https://avatars.githubusercontent.com/u/210097147?v=4)](https://github.com/caresome "caresome (15 commits)")

---

Tags

laravelpollfilamentfilament-plugincaresome

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/caresome-filament-poll/health.svg)

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

###  Alternatives

[pboivin/filament-peek

Full-screen page preview modal for Filament

253319.6k12](/packages/pboivin-filament-peek)[croustibat/filament-jobs-monitor

Background Jobs monitoring like Horizon for all drivers for FilamentPHP

254255.2k6](/packages/croustibat-filament-jobs-monitor)[dotswan/filament-map-picker

Easily pick and retrieve geo-coordinates using a map-based interface in your Filament applications.

124139.3k2](/packages/dotswan-filament-map-picker)[creagia/filament-code-field

A Filamentphp input field to edit or view code data.

58289.3k3](/packages/creagia-filament-code-field)[schmeits/filament-character-counter

This is a Filament character counter TextField and Textarea form field for Filament v4 and v5

33184.7k6](/packages/schmeits-filament-character-counter)[tapp/filament-google-autocomplete-field

Filament plugin that provides a Google Autocomplete field

3098.1k](/packages/tapp-filament-google-autocomplete-field)

PHPackages © 2026

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