laravel-acl 0,1 travis-ci Packagist

Light-weight role-based permissions system for Laravel 5 built in Auth system.

3 years after

Kodeine/Laravel-ACL

Laravel Source Build Status License Total Downloads

Laravel ACL adds role based permissions to built in Auth System of Laravel 5. ACL middleware protects routes and even crud controller methods.

Table of Contents

Requirements

  • This package requires PHP 5.4+

Getting Started

  1. Require the package in your composer.json and update your dependency with composer update:
"require": {
...
"kodeine/laravel-acl": "[email protected]",
...
},
  1. Add the package to your application service providers in config/app.php.
'providers' => [

'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
...
'Kodeine\Acl\AclServiceProvider',

],
  1. Publish the package migrations to your application and run these with `php artisan migrate.
$ php artisan vendor:publish --provider="Kodeine\Acl\AclServiceProvider"

Use your own models. Once you publish, it publishes the configuration file where you can define your own models which should extend to Acl models.

  1. Add the middleware to your app/Http/Kernel.php.
protected $routeMiddleware = [

....
'acl' => 'Kodeine\Acl\Middleware\HasPermission',

];
  1. Add the HasRole trait to your User model.
use Kodeine\Acl\Traits\HasRole;

class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
use Authenticatable, CanResetPassword, HasRole;
}

Documentation

Follow along the Wiki to find out more.

Roadmap

Here's the TODO list for the next release (2.0).

  • [ ] Refactoring the source code.
  • [ ] Correct all issues.
  • [ ] Adding cache to final user permissions.
  • [ ] Adding tests.

Change Logs

September 20, 2016

  • [x] Added support for Laravel 5.3

September 19, 2016

  • [x] Added cache support to Roles and Permissions.

June 14, 2015

March 28, 2015

  • [x] Added Role Scope to get all users having a specific role. e.g User::role('admin')->get(); will list all users having admin role.

March 7, 2015

  • [x] is() and can() methods now support comma for AND and pipe as OR operator. Or pass an operator as a second param. more information
  • [x] You can bind multiple permissions together so they inherit ones permission. more information

Contribution Guidelines

Support follows PSR-2 PHP coding standards, and semantic versioning.

Please report any issue you find in the issues page. Pull requests are welcome.

Related Repositories

laravel-authentication-acl

laravel-authentication-acl

Laravel authentication and ACL admin panel package based on sentry ...

awesome-laravel

awesome-laravel

A curated list of delightful Laravel PHP framework packages and resources ...

laravel

laravel

Gem for deploying Laravel projects with capistrano v3.* ...

laravel-acl-rbac

laravel-acl-rbac

Laravel Acl componnet which can filter urls/requests and models ...

laravel-zend-acl

laravel-zend-acl

Adds ACL to Laravel 4 via Zend\Permissions\Acl component. ...


Top Contributors

kodeine rafaelpv CptMeatball uzegonemad KhaledSMQ christianbartels Lagg RJacksonm1 RomainLanz TomasVotruba ajtrichards peetersdiet

Dependencies

package version
php >=5.5.9
illuminate/support ~5.0
dev phpunit/phpunit ~4.0
orchestra/testbench ~3.0
doctrine/dbal ^2.5

Releases

-   v0.1.3 zip tar
-   v0.1.2 zip tar
-   v0.1.1 zip tar
-   v0.1.0 zip tar