laravel-acl maintained by sztyup
Description
Light-weight role-based permissions for Laravel 5 built in Auth system. (forked by sztyup)
Authors
Ahsen M. - Sztyup
Last update
2017/07/25 18:21 (1.1.7.x-dev)
License
Downloads
222
Last update
2015/03/17 04:36
License
Require
- php >=5.4.0
- illuminate/support 4.2.x|~5.0
- illuminate/database 4.2.x|~5.0
Last update
2015/03/12 19:00
License
Require
- php >=5.4.0
- illuminate/support 4.2.x|~5.0
- illuminate/database 4.2.x|~5.0
Last update
2015/03/10 02:16
License
Require
- php >=5.4.0
- illuminate/support 4.2.x|~5.0
- illuminate/database 4.2.x|~5.0
comments powered by Disqus
Laravel ACL adds role based permissions to built in Auth System of Laravel 5. ACL middleware protects routes and even crud controller methods.
- This package requires PHP 5.5+
- Require the package in your
composer.json
and update your dependency withcomposer update
:
"require": {
...
"kodeine/laravel-acl": "~1.0@dev",
...
},
- Add the package to your application service providers in
config/app.php
.
'providers' => [
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
...
'Kodeine\Acl\AclServiceProvider',
],
- Publish the package migrations to your application and run these with `php artisan migrate.
$ php artisan vendor:publish --provider="Kodeine\Acl\AclServiceProvider"
Use your own models. Once you publish, it publishes the configuration file where you can define your own models which should extend to Acl models.
- Add the middleware to your
app/Http/Kernel.php
.
protected $routeMiddleware = [
....
'acl' => 'Kodeine\Acl\Middleware\HasPermission',
];
- Add the HasRole trait to your
User
model.
use Kodeine\Acl\Traits\HasRole;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
use Authenticatable, CanResetPassword, HasRole;
}
Follow along the Wiki to find out more.
Here's the TODO list for the next release (2.0).
- [ ] Refactoring the source code.
- [ ] Correct all issues.
- [ ] Adding cache to final user permissions.
September 22, 2016
- [x] Added unit tests
September 20, 2016
- [x] Added support for Laravel 5.3
September 19, 2016
- [x] Added cache support to Roles and Permissions.
June 14, 2015
- [x] Added backward compatibility to l5.0 for lists() method.
- [x] Added Blade Template Extensions.
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 havingadmin
role.
March 7, 2015
- [x]
is()
andcan()
methods now support comma forAND
and pipe asOR
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
Support follows PSR-2 PHP coding standards, and semantic versioning.
Please report any issue you find in the issues page. Pull requests are welcome.