2017 © Pedro Peláez
 

library roleable

Simple role management and authorization library for Laravel.

image

koterle/roleable

Simple role management and authorization library for Laravel.

  • Tuesday, July 21, 2015
  • by koterle
  • Repository
  • 3 Watchers
  • 3 Stars
  • 29 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Roleable

Simple role management for Laravel by Model class and ID for Laravel 5.1, (*1)

For Laravel 5.0 use the 1.0 branch. For laravel 4 use the 0.9 branch., (*2)

Install

Via Composer, (*3)

``` json { "require": { "koterle/roleable": "1.1.*" } }, (*4)


Update Composer: composer update --dev Once it completes, add the service provideer in your `config/app.php`. Koterle\Roleable\RoleableServiceProvider::class ## Usage Publish the config file and the migrations. Make sure you set your User model and User ID type correctly. ```php php artisan vendor:publish

Run the migrations., (*5)

php artisan migrate

Add the CanTrait to the User model:, (*6)

use CanTrait;

Fill up the database with the desired roles and permissions., (*7)

Now you can use (role name/permission, class, id):, (*8)

if (Auth::user()->is('administrator', 'Company', 1)) { ... }
if (Auth::user()->can('manage_users', 'Company', 1)) { ... }
if (Auth::user()->cannot('delete_posts', 'Blog', 1)) { ... }

Auth::user()->attachRole('administrator', 'Company', 1);
Auth::user()->detachRole('administrator', 'Company', 1);

License

The MIT License (MIT), (*9)

The Versions

21/07 2015

dev-master

9999999-dev

Simple role management and authorization library for Laravel.

  Sources   Download

MIT

The Requires

 

by Martin Koterle

laravel authorization roles

21/07 2015

1.1.0

1.1.0.0

Simple role management and authorization library for Laravel.

  Sources   Download

MIT

The Requires

 

by Martin Koterle

laravel authorization roles

08/01 2015

dev-l4

dev-l4

Simple role management and authorization library for Laravel.

  Sources   Download

MIT

The Requires

 

by Martin Koterle

laravel authorization roles

08/01 2015

0.9.1

0.9.1.0

Simple role management and authorization library for Laravel.

  Sources   Download

MIT

The Requires

 

by Martin Koterle

laravel authorization roles

08/01 2015

1.0.2

1.0.2.0

Simple role management and authorization library for Laravel.

  Sources   Download

MIT

The Requires

 

by Martin Koterle

laravel authorization roles

18/12 2014

0.9.0

0.9.0.0

Simple role management and authorization library for Laravel.

  Sources   Download

MIT

The Requires

 

by Martin Koterle

laravel authorization roles

16/10 2014

1.0.1

1.0.1.0

Simple role management and authorization library for Laravel.

  Sources   Download

MIT

The Requires

 

by Martin Koterle

laravel authorization roles

30/09 2014

1.0.0

1.0.0.0

Simple role management and authorization library for Laravel.

  Sources   Download

MIT

The Requires

 

by Martin Koterle

laravel authorization roles