/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $auth = Models\Auth::find($id); $allAuths = Models\Auth::getAuth(); $allAuths = getAuthTree($allAuths); return view('admin.auth.edit', compact('auth', 'allAuths')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { //获取当前角色的信息 $role = Models\Role::find($id); //获取当前角色所拥有的权限的ID $nowAuths = array(); foreach ($role->auths as $auth) { $nowAuths[] = $auth->id; } //获取所有权限的信息 $auths = Models\Auth::getAuth(); $auths = getTree($auths); return view('admin.role.edit', compact('role', 'auths', 'nowAuths')); }