ashamnx/acl

Laravel Route Based Acl

Maintainers

Details

github.com/ashamnx/acl

Source

Issues

Installs: 28

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:laravel

dev-master 2017-09-17 06:25 UTC

This package is not auto-updated.

Last update: 2025-01-28 18:39:47 UTC


README

Laravel Route based ACL.

Requirements

  • Laravel 5.4 with Passport

Getting Started

1.Install via composer require ashamnx/acl

2.Add the package to your application service providers in config/app.php.

'providers' => [
   ...
   Ashamnx\Acl\AclServiceProvider::class,

],

3.Migrate using php artisan migrate

4.Add the middleware to your app/Http/Kernel.php.

protected $routeMiddleware = [
    ....
    'acl' => \Ashamnx\Acl\Middleware\AclMiddleware::class,

];

5.Make sure all routes that use the middleware are named and the name has the format [prefix].[resource].[action]

Route::middleware(['acl'])->get('test/win', function() {
    return 'Testing win';
})->name('testing.win');

6.Run php artisan acl:init to create an Administrator group and give all access.