/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function update(UpdateRequest $request, $id) { $result = $this->userRepository->update($id, $request->all()); $result['status'] ? $alert = '用户更新成功' : ($alert = $result['error']); return redirect()->route('rbac.user.index')->with('message', $alert); }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id, UpdateRequest $updateRequest) { $result = $this->userRepository->update($id, $updateRequest->all()); if (!$result['status']) { $alert = ['type' => 'warning', 'data' => [$result['error']]]; } else { $alert = ['type' => 'success', 'data' => ['用户更新成功']]; } return redirect(route('admin.rbac.user.edit', ['id' => $id]))->with('am-alert', $alert); }