/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { if ($result = check_auth_to('QXZ_DELETE')) { return $result; } try { DB::transaction(function () use($id) { AuthGroupRelaionship::deleteAuthGroupRelationshipGroupLabel($id); AuthGroup::destroy($id); }); return redirect()->action('Admin\\AuthGroupController@index')->with('operationstatus', 'sucess'); } catch (\Exception $e) { return redirect()->back()->withErrors(['error' => '删除权限组失败,请重试(' . $e->getMessage() . ')']); } }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { if ($result = check_auth_to('JSLB_EDIT')) { return $result; } $data['authGroupList'] = AuthGroup::all(); $data['roleInfo'] = Role::find($id); return view('admin.role.edit', $data); }