Download the PHP package thinkingmik/acl-manager-laravel without Composer
On this page you can find all versions of the php package thinkingmik/acl-manager-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thinkingmik/acl-manager-laravel
More information about thinkingmik/acl-manager-laravel
Files in thinkingmik/acl-manager-laravel
Package acl-manager-laravel
Short Description A Laravel 5 access control list package
License MIT
Informations about the package acl-manager-laravel
PHP ACL Manager for Laravel 5
Versions
Laravel | ACL Manager | PHP |
---|---|---|
4.2.x | 1.x | >= 5.4 |
5.0.x | 2.x | >= 5.4 |
Summary
- Introduction
- Installation
- Setup
- Migrations and configuration file
- Migrations
- Configuration
- Usage
- Routing
- Facade
- License
Introduction
Adds ACL to Laravel 5. This ACL solution for Laravel is useful when you need to store policy rules or users' roles into a database. ACL Manager are composed by three entities:
- Roles
- Resources
- Permissions
Installation
Add the following line to the require
section of composer.json
:
Setup
- Add
'ThinKingMik\AclManager\AclManagerServiceProvider',
into the service provider list inconfig/app.php
. - Add
'Acl' => 'ThinKingMik\AclManager\Facades\AclManagerFacade',
into the list of aliases inconfig/app.php
. - Add
'ThinKingMik\AclManager\Middleware\AclManagerExceptionHandler',
into the list of middlewere inapp/Http/Kernel.php
.
Migrations and configuration file
In order to use the Acl Manager publish its configuration and migrations first
Note: migrations are only published, remember to run them when ready.
Migrations
This package comes with all the migrations you need to run a full featured Acl Manager. First of all you need to check the reference to the user table name:
-
Check the users table name of your Laravel installation in
config/auth.php
at the section: -
Change the table reference for
user_id
foreign key in these filesdatabase/migrations
: -
Check
user_id
foreign key in all the above files to be sure that the user table name is the same as'table' => 'system_users'
: - Now you can run:
Configuration
Edit the file to suit your needs.
Usage
Routing
You can use Acl Manager in routes as a filter
All checks are made on user_id
attribute retrieved from session.
You can define many different acl:
filters:
You can also combine these filters with ;
separator like:
Facade
The Acl Manager is available through the Facade Acl
or through the acl service in the IOC container.
The methods available are:
License
This package is released under the MIT License.