Download the PHP package laravel-afterburner/voting without Composer
On this page you can find all versions of the php package laravel-afterburner/voting. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravel-afterburner/voting
More information about laravel-afterburner/voting
Files in laravel-afterburner/voting
Package voting
Short Description Team-scoped voting and ballots for Afterburner applications
License MIT
Informations about the package voting
Afterburner Voting Package
Team-scoped ballots and vote casting for Laravel Afterburner Jetstream.
Installation
Local Development Setup
For local development, add the package as a path repository:
Quick Install
Add the HasVoting trait to your App\Models\Team model:
Permissions
This package uses existing Afterburner template permission slugs:
vote_resolutions— cast votes on open ballotscreate_resolutions— create and publish ballots
The install seeder also adds package-specific permissions:
manage_ballotsview_ballot_resultsmanage_proxy_votesexport_ballot_results
Voter units
Votes are keyed to a voter unit (morph), not a user. BallotResponse stores:
cast_by_user_id— who submitted the votevoter_unit_type+voter_unit_id— what entity the vote represents
The default resolver treats each user as their own voter unit (one person, one vote).
Strata integration
Strata apps assign one vote per property/lot. Implement a custom resolver:
Register in .env:
Critical invariant
ballot_responses has a unique constraint on (ballot_id, voter_unit_type, voter_unit_id). Once a lot has voted on a ballot, changing the designated voter cannot allow a second vote for that lot.
Weighted votes (strata entitlement)
Implement Afterburner\Voting\Contracts\ProvidesWeightedVotes on your resolver and return unit entitlement per lot:
Tally and CSV/PDF exports use weighted counts when the bound resolver implements this contract, or when the team default vote weight per lot is set in voting settings.
Multi-lot owner voting
When a user is eligible to vote for two or more owned lots (not proxies) on the same ballot, the ballot page defaults to a single form that records the same choice for all listed lots. A Vote separately for each lot option switches to per-lot forms. Proxy lots always use individual forms.
Phase 3 features
| Feature | Config / usage |
|---|---|
| Vote revocation (withdraw vote, no re-cast) | AFTERBURNER_VOTING_ALLOW_VOTE_REVOCATION=true — tombstone in ballot_vote_revocations |
| Scheduled open/close | AFTERBURNER_VOTING_SCHEDULE_TRANSITIONS=true — queued jobs on publish + afterburner:voting:process-scheduled every minute |
| PDF results export | Install barryvdh/laravel-dompdf, export via ?format=pdf on results export route |
| Weighted tally | Resolver implements ProvidesWeightedVotes |
Attendance tracking is intentionally deferred to a future meetings package.
Team voting settings
Team admins can configure defaults in System Settings → Voting (/teams/{team}/system-settings):
| Setting | Purpose |
|---|---|
| Default quorum (%) | Applied to new ballots; optional |
| Default vote weight per lot | Set to 1 when every lot counts equally; leave empty to set weight per lot in the host property register |
| Default vote visibility | Confidential, visible after close, or visible in realtime |
| Allow proxy votes | Team-level toggle (global kill switch in config still applies) |
| Lock designation during open ballots | Stored preference for host apps; not enforced by this package |
New ballots inherit team defaults via TeamVotingSettings. Individual ballots can override quorum and visibility on the create form.
HasVoting::votingSettings() exposes the TeamVotingSetting record for the team.
Custom electorate
For ballots with electorate = custom, register a class implementing CustomElectorateResolver:
The class is validated on boot and required when publishing custom-electorate ballots.
Voter notifications
The package fires BallotPublished but does not send email. A stub listener SendBallotPublishedVoterNotifications is registered by default. Subscribe to BallotPublished in your host app (or replace the listener) to notify eligible voters.
Routes
/teams/{team}/ballots— ballot index/teams/{team}/ballots/create— create ballot/teams/{team}/ballots/{ballot}— ballot detail and voting/teams/{team}/ballots/{ballot}/results— results after close/teams/{team}/ballots/{ballot}/results/export— CSV (default) or PDF (?format=pdf)/teams/{team}/voting/proxies— proxy vote management (whenAFTERBURNER_VOTING_PROXY_GRANT_RESOLVERis configured)
Team voting defaults are configured under System Settings → Voting (/teams/{team}/system-settings).
Testing
Or:
Document attachments
When laravel-afterburner/documents is installed, ballots can link to completed team documents so voters can review supporting material.
-
Run documents migrations (includes
document_links): - Ensure both packages are installed in the host app (Strata already uses path repos for both).
On the ballot show and edit pages, a Supporting documents section lists attached files. Preview (eye icon) opens PDFs, images, and plain text in the browser via teams.documents.preview; download remains available when permitted.
Linking uses the documents package document_links pivot (LinkDocument / UnlinkDocument actions). Only upload_status = completed documents can be attached. Documents must belong to the same team as the ballot.
Disable integration with AFTERBURNER_VOTING_DOCUMENTS_ENABLED=false.
UI conventions
Package views use the host app's Blade button components (same as afterburner-documents):
<x-button>— primary actions (Create Ballot, Publish, Submit Vote)<x-secondary-button>— secondary actions (Save Draft, Close, View Results)<x-danger-button>— destructive actions- Icon-only inline row actions — remove/edit/delete beside list rows (SVG +
title, no visible text; see documentsindex.blade.php)
Do not use raw bg-indigo-* classes for buttons. Do not use text labels like "Remove" on compact row actions. Republish views after UI updates:
License
MIT License — see LICENSE for details.
All versions of voting with dependencies
laravel/framework Version ^11.0
laravel-afterburner/jetstream Version ^1.0|dev-master
livewire/livewire Version ^3.5