Download the PHP package aginev/acl without Composer
On this page you can find all versions of the php package aginev/acl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package acl
Short Description ACL package for Laravel v5.0
License MIT
Homepage http://aginev.com
Informations about the package acl
ACL For Laravel 5
Access control list implementation form Laravel 5. Gives you roles and permissions for build in Laravel 5 Auth.
Features
- CRUD for roles
- CRUD fot permissions
- Route middleware for checking user permissions
- Artisan command for parsing and adding newly created ACL dependant modules
- Composer installable
- PSR4 auto loading
- PSR2 code formatting
Requires
Build only for Laravel Framework only! The package required Glyph icons (http://glyphicons.com/).
Installation
Require package at your composer.json file like so
Tell composer to update your dependencies
Or in terminal
Add Service Provider to your config/app.php like so
Publish package assets
Add package CSS to your layout
Add package javascript to your layout.
- script.js to be able to define role permission easily
- restful.js to be able to execute RESTful delete
Feel free to make your own implementation if you don't have one already.
Add Laravel csrf token as a javascript object. Required only if use restful.js.
Run package migrations. You need to have your users table migrated.
Seed the roles table. By default it will create two roles- No Permissions and Admin. No Permissions roles will be considered as a default role. You will be not able to delete this role. When deleting other role, all users using deleted role will be assigned to No Permissions role. By default the seeder will add all resources requesting ACL and will assign them to Admin role.
Modify one or more of your users to have a valid role_id. By default the added role_id foreign key will have a value of NULL
Add ACL user trait to your User model. It will add definition for the relation between roles and users table;
At this point you have ACL up and running. Access roles and permissions CRUD at:
/admin/role
/admin/permission
Not happy with the route prefix? Publish the package config and edit routes_prefix value for your own or leave it blank for no prefix.
Edit route prefix
Package has a pagination in index views. If you need more items per page, edit per_page_results (default to 25) value at the config.
To define custom error messages format, edit validation_errors_format value at the config. This format will be applied only if your controllers are extending ACL base controller (\Aginev\Acl\Http\Controllers\AclController).
And the most important thing... you want your controller to be ACL dependent. There two options for this.
1.Add ACL middleware at your controller constructor.
2.Route group at routes.php
After defining a ACL protected controllers like this you are able to run artisan command that will add all the routes in the permissions table
If you want to assign new permissions to role you can do it like so
Where 2 is the role_id. If you want pass many roles do it with comma separates list If you want to assign new permissions to role you can do it like so
Modifying default view
To modify default views you need to publish them
Other
Publish migrations
Publish seeds
License
All versions of acl with dependencies
illuminate/foundation Version 5.1.*
illuminate/contracts Version 5.1.*
illuminate/database Version 5.1.*
illuminate/routing Version 5.1.*
illuminate/support Version 5.1.*
illuminate/view Version 5.1.*
illuminate/html Version 5.*