Package Data | |
---|---|
Maintainer Username: | xyezir |
Package Create Date: | 2015-12-04 |
Package Last Update: | 2015-12-04 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-22 15:04:12 |
Package Statistics | |
---|---|
Total Downloads: | 16 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Laravel ACL adds role based permissions to built in Auth System of Laravel 5. ACL middleware protects routes and even crud controller methods.
composer.json
and update your dependency with composer update
:"require": {
...
"kodeine/laravel-acl": "~1.0@dev",
...
},
config/app.php
.'providers' => [
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
...
'Kodeine\Acl\AclServiceProvider',
],
$ 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.
app/Http/Kernel.php
.protected $routeMiddleware = [
....
'acl' => 'Kodeine\Acl\Middleware\HasPermission',
];
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).
June 14, 2015 (latest)
March 28, 2015
User::role('admin')->get();
will list all users having admin
role.March 7, 2015
is()
and can()
methods now support comma for AND
and pipe as OR
operator. Or pass an operator as a second param. 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.