public function boot() { $this->registerPolicies(); // $permissions = \App\AdminPermission::with('roles')->get(); foreach ($permissions as $permission) { Gate::define($permission->name, function($user) use($permission) { return $user->hasPermission($permission); }); } }
施帅帅