2017 © Pedro Peláez
 

library laravel-acl

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

image

kodeine/laravel-acl

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

  • Monday, February 12, 2018
  • by kodeine
  • Repository
  • 68 Watchers
  • 674 Stars
  • 118,103 Installations
  • PHP
  • 9 Dependents
  • 0 Suggesters
  • 175 Forks
  • 61 Open issues
  • 7 Versions
  • 8 % Grown

The README.md

Kodeine/Laravel-ACL

Laravel Source Build Status License Total Downloads, (*1)

Laravel ACL adds role based permissions to built in Auth System of Laravel 9.0+. ACL middleware protects routes and even crud controller methods., (*2)

Table of Contents

Requirements

  • Version 2.x of this package requires PHP 7.2+ and Laravel 6.0+
  • Version 1.x requires PHP 5.6+ and Laravel 5.0+

Getting Started

Install the package using composer, (*3)

composer require kodeine/laravel-acl

If you need to support Laravel 5.x, make sure to install version 1.x, (*4)

composer require kodeine/laravel-acl "^1.0"
  1. If you are using Laravel before version 5.4, manually register the service provider in your config/app.php file
'providers' => [
    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'Kodeine\Acl\AclServiceProvider',
],
  1. Publish the package configuartion files and add your own models to the list of ACL models"
$ php artisan vendor:publish --provider="Kodeine\Acl\AclServiceProvider"

Once you publish, it publishes the configuration file where you can: - Use your own models: Define your own models which should extend to Acl models. - Use your own guard: Define a guard other than laravel default for user recovery., (*5)

  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;
}
  1. Run the migrations to generate your roles and permissions tables

Please note that if you are upgrading to 6.0 from a previous version, the default column type for the id on the users table has changed. On certain databases foreign keys can only be defined with matching column types. As such, you will need to change the id column on your users table to bigInteger in to user this package., (*6)

php artisan migrate

Documentation

Follow along the Wiki to find out more., (*7)

Roadmap

Here's the TODO list for the next release., (*8)

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

Change Logs

June 14 2022 * [x] Added support for different guard, (*9)

September 14 2019 * [x] Updated the readme to reflect new major release, (*10)

September 13, 2019 * [x] Added support for Laravel 6, (*11)

*September 22, 2016** * [x] Added unit tests, (*12)

*September 20, 2016** * [x] Added support for Laravel 5.3, (*13)

September 19, 2016 * [x] Added cache support to Roles and Permissions., (*14)

June 14, 2015 * [x] Added backward compatibility to l5.0 for lists() method. * [x] Added Blade Template Extensions., (*15)

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., (*16)

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, (*17)

Contribution Guidelines

Support follows PSR-2 PHP coding standards, and semantic versioning., (*18)

Please report any issue you find in the issues page. Pull requests are welcome., (*19)

The Versions

12/02 2018

1.0.x-dev

1.0.9999999.9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel acl auth roles permissions eloquent security

12/02 2018

dev-revert-216-1.0

dev-revert-216-1.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel acl auth roles permissions eloquent security

12/06 2017

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel acl auth roles permissions eloquent security

17/03 2015

v0.1.3

0.1.3.0

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

  Sources   Download

MIT

The Requires

 

laravel acl auth roles permissions eloquent security kodeine

12/03 2015

v0.1.2

0.1.2.0

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

  Sources   Download

MIT

The Requires

 

laravel acl auth roles permissions eloquent security kodeine

10/03 2015

v0.1.1

0.1.1.0

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

  Sources   Download

MIT

The Requires

 

laravel acl auth roles permissions eloquent security kodeine

24/02 2015

v0.1.0

0.1.0.0

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

  Sources   Download

MIT

The Requires

 

laravel acl auth roles permissions eloquent security kodeine