Package Data | |
---|---|
Maintainer Username: | zezont4 |
Maintainer Contact: | zezont@gmail.com (Abdulaziz Tayyar) |
Package Create Date: | 2016-04-12 |
Package Last Update: | 2020-07-27 |
Language: | JavaScript |
License: | MIT |
Last Refreshed: | 2024-11-22 03:17:06 |
Package Statistics | |
---|---|
Total Downloads: | 7 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
PHP >= 5.5.9
Laravel >=5.2
Auto Loaded : [laravelcollective/html package for form & html](https://laravelcollective.com/docs/5.2/html)
This package is based on @heerasheikh post :
http://heera.it/laravel-5-1-x-acl-middleware#.Vwxunpl95TH
with some fixes , improvment and interface
1.Run
composer require zezont4/laravel-acl
2.Add service provider & Aliases to /config/app.php file.
'providers' => [
\\ Other Providers,
Zezont4\ACL\ACLServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
],
'aliases' => [
\\ Other Aliases,
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
],
3.Add acl middleware to **app\Http\Kernel.php **
protected $routeMiddleware = [
\\ Other routeMiddleware,
'acl' => \Zezont4\ACL\Http\Middleware\CheckPermission::class,
];
4.use UserTrait app\User.php
class User extends Authenticatable
{
use \Zezont4\ACL\Models\UserTrait;
\\ the rest of the class
}
5.Publish assets and config file
php artisan vendor:publish --provider="Zezont4\ACL\ACLServiceProvider" --tag="config" --tag="assets"
6.Use it like this in your routs
Route::get('/users', [
'middleware' => 'acl:manage_user',
'as' => 'users.all',
'uses' => 'UserController@index'
]);
@hasRole('manager')
....
@endhasRole
The MIT License (MIT). Please see License File for more information.