laravel 授权使用gate门类

第一:先注册

第二:使用方式三种

  路由中:Route::group(['middleware'=>'can:system'],function() {})

  模板中:@can("system")

  控制器中:$this->authorize('update',$post)  

原文地址:https://www.cnblogs.com/lxwphp/p/9304431.html