2017 © Pedro Peláez
 

library laravel-permission

A Simple permission check to laravel.

image

leandreaci/laravel-permission

A Simple permission check to laravel.

  • Friday, November 4, 2016
  • by leandreaci
  • Repository
  • 1 Watchers
  • 0 Stars
  • 57 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 73 % Grown

The README.md

Laravel Permission

Laravel 5.3, (*1)

At the moment the package is not unit tested, but is planned to be covered later down the road., (*2)

Quick Installation

Begin by installing the package through Composer. The best way to do this is through your terminal via Composer itself:, (*3)

composer require leandreaci\laravel-permission:dev-master

Or add to you composer.json and run composer install., (*4)

"require": { "Foo/Bar" : "*", "leandreaci/laravel-permission": "dev-master" },, (*5)

Once this operation is complete, simply add the service provider to your project's config/app.php file and run the provided migrations against your database., (*6)

Service Provider

Leandreaci\LaravelPermission\LaravelPermissionServiceProvider::class

in the providers array and

'Permission' => Leandreaci\LaravelPermission\Facade\LaravelPermission::class,

Migrations

You'll need to run the provided migrations against your database. Publish the migration files using the vendor:publish Artisan command and run migrate:, (*7)

php artisan vendor:publish
php artisan migrate

Using

1 - Add permission slug to permissions table. 2 - Add user and permission equivalent to permission_user table. 3 - Add Authorizable Trait to your User Model( Example above: Laravel 5.3)., (*8)

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Leandreaci\LaravelPermission\Traits\Authorizable;

class User extends Authenticatable
{
    use Notifiable;
    use Authorizable;

4 - Check any method of your controller, (*9)


use Leandreaci\LaravelPermission\Facade\Permission; class FooController { public function index() { if(! Permission::can('view.foo')) { //do what you want ;) } } }

The Versions

04/11 2016

dev-master

9999999-dev https://github.com/leandreaci/laravel-permission

A Simple permission check to laravel.

  Sources   Download

MIT

The Requires

 

by Leandro Andreaci

laravel easy permission

20/10 2016

0.0.3

0.0.3.0 https://github.com/leandreaci/laravel-permission

A Simple permission check to laravel.

  Sources   Download

MIT

The Requires

 

by Leandro Andreaci

laravel easy permission

13/10 2016

0.0.2

0.0.2.0 https://github.com/leandreaci/laravel-permission

A Simple permission check to laravel.

  Sources   Download

MIT

The Requires

 

by Leandro Andreaci

laravel easy permission

13/10 2016

0.0.1

0.0.1.0 https://github.com/leandreaci/laravel-permission

A Simple permission check to laravel.

  Sources   Download

MIT

The Requires

 

by Leandro Andreaci

laravel easy permission