2017 © Pedro Peláez
 

library poll

Poll package for Laravel

image

abstracteverything/poll

Poll package for Laravel

  • Wednesday, February 21, 2018
  • by AbstractEverything
  • Repository
  • 1 Watchers
  • 2 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 43 % Grown

The README.md

Build Status, (*1)

Poll Package for Laravel 5.5

Installation

Run composer require 'abstracteverything/poll', (*2)

OR add:, (*3)

{
    "require": {
        "abstracteverything/poll": "dev-master"
    }
}

to your composer.json file and run composer update., (*4)

Setup

Add AbstractEverything\Poll\PollServiceProvider to your providers array in config/app.php., (*5)

Optionally register the following two facades in config/app.php:, (*6)

  • 'Poll' => AbstractEverything\Poll\Facades\Poll::class,
  • 'Vote' => AbstractEverything\Poll\Facades\Vote::class,

Publishing assets

To publish package assets run: php artisan vendor:publish and choose AbstractEverything\Poll\PollServiceProvider this will publish the following files:, (*7)

  • Views to: resources/vendor/abstracteverything/poll
  • Config to: config/poll.php
  • Migrations to database/migrations

Run the database migrations by running php artisan migrate, (*8)

Setting up the poll user

The user class needs to implement the AbstractEverything\Poll\Extras\PollUserInterface interface and use the AbstractEverything\Poll\Extras\PollUser trait., (*9)

Overriding default routes

The package ships with a default set of routes:, (*10)

  • /polls - polls.index (GET)
  • /polls - polls.store (POST)
  • /polls/create - polls.create (GET)
  • /polls/{poll} - polls.show (GET)
  • /polls/{poll} - polls.destroy (GET)
  • /votes - votes.store (POST)

You can override these by redefining a route with the same name:, (*11)

Route::get('custom_create_page', [
    'as' => 'polls.create',
    'uses' => '\AbstractEverything\Poll\Http\Controllers\PollController@create',
]);

Middleware configuration

Routes for creating, destroying polls can be protected by middleware. In config/poll.php you can set which middleware should be used., (*12)

Configuration

Other configuration options are avaliable in config/poll.php., (*13)

The Versions

21/02 2018

dev-master

9999999-dev

Poll package for Laravel

  Sources   Download

The Requires

 

The Development Requires

by Rupert Franks

04/12 2017

dev-develop

dev-develop

Poll package for Laravel

  Sources   Download

The Requires

 

The Development Requires

by Rupert Franks