Download the PHP package codegor/laravel-acl without Composer
On this page you can find all versions of the php package codegor/laravel-acl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codegor/laravel-acl
More information about codegor/laravel-acl
Files in codegor/laravel-acl
Package laravel-acl
Short Description Resource Laravel ACL and Resource ACL for Laravel Model by it status based on Laravel route table. Easy code, easy control
License MIT
Homepage https://github.com/codegor/laravel-acl
Informations about the package laravel-acl
Codegor/laravel-acl
Laravel ACL adds role based permissions to built in Auth System of Laravel 5.6. ACL middleware protects routes. Useful when laravel use for server api(with resource controller). Current ACL can control resource by its statuses (very usfull if you need control what actions need deny). If model has some status, for example, model has status 'active' and you want to deny action 'update' - with this ACL you can set this in the config at state field (see below).
Table of Contents
- Requirements
- Getting Started
Requirements
- This package requires PHP 7.0+
Getting Started
-
Require the package in your
composer.json
and update your dependency withcomposer update
: -
Add the package to your application service providers in
config/app.php
. -
Publish the package config to your application. if you want def migration has on migrations folder at root folder of packege.
-
Add the middleware to your
app/Http/Kernel.php
. -
Add the Acl trait to your
User
model. - Config your acl on config/acl.php (Detail on the comments at config/acl.php file).
That's All!
For creating permission list you can exec artisan command 'php artisan route:list' and you can see your rout table and col route name, this col you are need for list in the permission list (at middleware col you can see your acl middleware with others middleware). Acl works only if you apply 'acl' middleware. (For internal needs you can use Acl::getPointsApp() which return the list of all permissions)