Skip to content

darkperis/wcms-polls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WCMSPolls

A Laravel package to manage polls on Darkpony Barb CMS

Installation:

First, install the package through Composer.

composer require darkperis/wcms-polls

Publish migrations, and migrate

php artisan vendor:publish
php artisan migrate

Set up the admin middleware's name

A wcmspolls_config.php file will be added where you can put the name of the middleware used to protect the access and other things like pagination and prefix to protect your routes Add this line in the .env too

POLL_ADMIN_AUTH_MIDDLEWARE = auth
POLL_ADMIN_AUTH_GUARD = web
POLL_PAGINATION = 10
POLL_PREFIX = custompath

Manage polls via Polls dashboard

FRONT END USE

Specify the ID of the poll

{{ PollWriter::draw(Darkpony\WCMSPolls\Poll::find([POLL_ID])) }}

Override views

You can override the views related to the results page and both pages checkbox/radio via the same wcmspolls_config.php file in the config folder.

Route of the vote action

{{ route('poll.vote', $id) }}

Data passed to result view

  • $question : the question of the poll
  • $options : array of objects holding (name, percent, votes).

Data passed to the poll checkbox/radio

  • $question : the question
  • $options : holding the name and id of the option.

Warning - This is a private use package.

Warning - Do not use outside Darkpony Digital.

About

Polls for Barb CMS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published