public function edit($id) { if (Auth::user()->can('update-roles')) { $role = Role::findOrFail($id); $role_permission = Role::find($id)->permissions()->lists('permission_id')->toArray(); $permissions = Permission::lists('display_name', 'id'); return view('auth::role.edit', compact('role', 'permissions', 'role_permission')); } return redirect('auth/logout'); }
public function destroy(Request $request, $id) { // todo protect system roles? Role::find($id)->delete(); return $this->createDefaultResponse($request); }