2017 © Pedro Peláez
 

library lavoter

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication. This means that for the identification of the user, we will use the fingerprintjs2 instead of authorization on the site.

image

zvermafia/lavoter

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication. This means that for the identification of the user, we will use the fingerprintjs2 instead of authorization on the site.

  • Wednesday, July 25, 2018
  • by zvermafia
  • Repository
  • 1 Watchers
  • 1 Stars
  • 318 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 14 Versions
  • 10 % Grown

The README.md

Lavoter

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication. This means that for the identification of the user, we will use the fingerprintjs2 instead of authorization on the site., (*1)

Installation

First, pull in the package through Composer., (*2)

composer require zvermafia/lavoter

Include the service provider within config/app.php., (*3)

'providers' => [
    // ...
    Zvermafia\Lavoter\LavoterServiceProvider::class
],

You need to publish and run the migration., (*4)

php artisan vendor:publish --provider="Zvermafia\Lavoter\LavoterServiceProvider"
php artisan migrate

To initialize the fingerprintjs2 and to set an uuid for the user you must to include a view part of this package to your site template. After the fingerprintjs2 initialized will be declared a global JavaScript variable with the name lavoter_uuid., (*5)

For example:, (*6)


<!DOCTYPE html>
<html lang="en">
    <head>
        <title>@yield('title', 'The App Name')</title>
    </head>
    <body>
        @yield('body')

        <!-- Don't forget jQuery must be included too  -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

        <!-- And here a view part of this package -->
        @include('lavoter::get')
    </body>
</html>

To finish installing add a cookie name within app/Http/Middleware/EncryptCookies.php. For example:, (*7)

<?php

namespace App\Http\Middleware;

use Illuminate\Cookie\Middleware\EncryptCookies as BaseEncrypter;

class EncryptCookies extends BaseEncrypter
{
    /**
     * The names of the cookies that should not be encrypted.
     *
     * @var array
     */
    protected $except = [
        'lavoter_uuid',
    ];
}

Setup a Model

<?php

namespace App;

use Zvermafia\Lavoter\Contracts\Voteable;
use Zvermafia\Lavoter\Traits\Voteable as VoteableTrait;
use Illuminate\Database\Eloquent\Model;

class Article extends Model implements Voteable
{
    use VoteableTrait;
}

Usage

// Before you need to import a Vote model
use Zvermafia\Lavoter\Models\Vote;

// Up-vote
Vote::up($article, $uuid);

// Down-vote
Vote::down($article, $uuid);

The Versions

25/07 2018

dev-master

9999999-dev

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication. This means that for the identification of the user, we will use the fingerprintjs2 instead of authorization on the site.

  Sources   Download

MIT

The Requires

 

25/07 2018

4.0.0

4.0.0.0

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication. This means that for the identification of the user, we will use the fingerprintjs2 instead of authorization on the site.

  Sources   Download

MIT

The Requires

 

05/04 2017

3.0.1

3.0.1.0

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication. This means that for the identification of the user, we will use the fingerprintjs2 instead of authorization on the site.

  Sources   Download

MIT

The Requires

 

05/12 2016

3.0.0

3.0.0.0

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication. This means that for the identification of the user, we will use the fingerprintjs2 instead of authorization on the site.

  Sources   Download

MIT

The Requires

 

24/11 2016

2.0.2

2.0.2.0

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication

  Sources   Download

MIT

The Requires

 

24/11 2016

2.0.1

2.0.1.0

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication

  Sources   Download

MIT

The Requires

 

22/11 2016

2.0.0

2.0.0.0

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication

  Sources   Download

MIT

The Requires

 

10/06 2016

1.0.0

1.0.0.0

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication

  Sources   Download

MIT

The Requires

 

by Mokhirzhon Naimov

22/04 2016

0.1.4

0.1.4.0

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication

  Sources   Download

MIT

The Requires

 

by Mokhirzhon Naimov

21/04 2016

0.1.3

0.1.3.0

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication

  Sources   Download

MIT

The Requires

 

by Mokhirzhon Naimov

21/04 2016

0.1.2

0.1.2.0

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication

  Sources   Download

MIT

The Requires

 

by Mokhirzhon Naimov

21/04 2016

dev-dev

dev-dev

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication

  Sources   Download

MIT

The Requires

 

by Mokhirzhon Naimov

21/04 2016

0.1.1

0.1.1.0

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication

  Sources   Download

MIT

The Requires

 

by Mokhirzhon Naimov

21/04 2016

0.1.0

0.1.0.0

Voteable Polymorphic Eloquent Models for Laravel 5 without user authentication

  Sources   Download

MIT

The Requires

 

by Mokhirzhon Naimov