实现思想


laravel权限控制Gate_ide

注册

位置: app/Providers/AuthServiceProvider.php

$permissions    = \App\AdminPermission::all();
foreach ($permissions as $permission){
Gate::define($permission->name,function ($user) use($permission){
return $user->hasPermission($permission);
});
}

laravel权限控制Gate_ide_02

 路由

Route::group(['middleware'=>'can:systems'],function(){});

laravel权限控制Gate_laravel_03

页面模版

laravel权限控制Gate_laravel_04