當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserRepository::update方法代碼示例

本文整理匯總了PHP中App\Repositories\UserRepository::update方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserRepository::update方法的具體用法?PHP UserRepository::update怎麽用?PHP UserRepository::update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在App\Repositories\UserRepository的用法示例。


在下文中一共展示了UserRepository::update方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int $id
  * @param UserEditPasswordRequest $request
  * @return Response
  */
 public function update($id, UserEditPasswordRequest $request)
 {
     $input = $request->only('password', 'password_confirmation');
     $user = $this->userRepository->update($id, $input);
     Flash::message('Contraseña actualizada');
     return Redirect()->route('profile.edit', $user->username);
 }
開發者ID:alons182,項目名稱:guanacastevende,代碼行數:14,代碼來源:UsersController.php

示例2: update

 /**
  * Update the specified user in storage.
  *
  * @param  int $id
  * @param UserEditRequest $request
  * @return Response
  */
 public function update($id, UserEditRequest $request)
 {
     $input = $request->only('username', 'email', 'password', 'password_confirmation');
     $this->userRepository->update($id, $input);
     Flash::message('User updated');
     return Redirect()->route('users');
 }
開發者ID:alons182,項目名稱:guanacastevende,代碼行數:14,代碼來源:UsersController.php

示例3: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(UserRepository $userRepository)
 {
     $user = $userRepository->find($this->user['id']);
     if (!Hash::check($this->params['old_password'], $user->password)) {
         throw new PasswordNotMatch();
     }
     $password = bcrypt($this->params['password']);
     return $userRepository->update($this->user['id'], ['password' => $password]);
 }
開發者ID:team-ccsad,項目名稱:project-101,代碼行數:14,代碼來源:ChangePassword.php

示例4: update

 /**
  * Update the specified User in storage.
  * PUT/PATCH /users/{id}
  *
  * @param  int              $id
  * @param Request $request
  *
  * @return Response
  */
 public function update($id, Request $request)
 {
     $input = $request->all();
     /** @var User $user */
     $user = $this->userRepository->apiFindOrFail($id);
     $result = $this->userRepository->update($input, $id);
     $user = $user->fresh();
     return $this->sendResponse($user->toArray(), "User updated successfully");
 }
開發者ID:jonphipps,項目名稱:api-registry,代碼行數:18,代碼來源:UserAPIController.php

示例5: updateUser

 public function updateUser(array $data, $id)
 {
     try {
         $user = $this->userRepository->update($data, $id);
     } catch (RepositoryException $e) {
         Log::warning('An additional info of the user (id:' . $id . ' ) information was\'nt updated. ' . $e->getMessage());
         throw new AuthException($e->getMessage(), null, $e);
     }
     return $user;
 }
開發者ID:BinaryStudioAcademy,項目名稱:reviewr,代碼行數:10,代碼來源:AuthService.php

示例6: update

 /**
  * Update the specified User in storage.
  *
  * @param  int              $id
  * @param UpdateUserRequest $request
  *
  * @return Response
  */
 public function update($id, UpdateUserRequest $request)
 {
     $user = $this->userRepository->find($id);
     if (empty($user)) {
         Flash::error('User not found');
         return redirect(route('users.index'));
     }
     $user = $this->userRepository->update($request->all(), $id);
     Flash::success('User updated successfully.');
     return redirect(route('users.index'));
 }
開發者ID:jonphipps,項目名稱:api-registry,代碼行數:19,代碼來源:UserController.php

示例7: update

 /**
  * Update the specified User in storage.
  *
  * @param  int $id
  * @param UpdateUserRequest $request
  *
  * @return Response
  */
 public function update($id, UpdateUserRequest $request)
 {
     $this->authorize('users.manage');
     $user = $this->userRepository->findWithoutFail($id);
     if (empty($user)) {
         Flash::error('User not found');
         return redirect(route('users.index'));
     }
     $input = $request->all();
     if (!empty($input['password'])) {
         $input['password'] = bcrypt($input['password']);
     } else {
         unset($input['password']);
     }
     $user = $this->userRepository->update($input, $id);
     $user->roles()->sync([$request->get('role')]);
     Flash::success('User updated successfully.');
     return redirect(route('users.index'));
 }
開發者ID:exfriend,項目名稱:larabox,代碼行數:27,代碼來源:UserController.php

示例8: updateSeen

 /**
  * Update the specified resource in storage.
  *
  * @param  Illuminate\Http\Request $request
  * @param  App\Models\User $user
  * @return Response
  */
 public function updateSeen(Request $request, $user)
 {
     $this->user_gestion->update($request->all(), $user);
     return response()->json();
 }
開發者ID:nitsmax,項目名稱:els,代碼行數:12,代碼來源:UserController.php

示例9: postProfile

 /**
  * Handle a change profile request for the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  App\Repositories\UserRepository
  * @return \Illuminate\Http\Response
  */
 public function postProfile(Request $request, UserRepository $userRepository)
 {
     $this->validate($request, ['name' => 'required|max:255']);
     //print_r($request); die;
     $user = $userRepository->update($request);
     return redirect('/auth/profile');
 }
開發者ID:purgesoftwares,項目名稱:bloodapp,代碼行數:14,代碼來源:AuthController.php

示例10: update

 /**
  * Update the specified resource in storage.
  *
  * @param UserRequest $request
  * @param int         $id
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function update(UserRequest $request, $id)
 {
     $this->users->update($request->all(), $id);
     return redirect()->route('admin.users.index');
 }
開發者ID:pet1330,項目名稱:tyloo,代碼行數:13,代碼來源:UsersController.php

示例11: update

 /**
  * Update the user.
  *
  * @param UserRepository $userRepository
  * @param SettingsUpdateRequest $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function update(UserRepository $userRepository, SettingsUpdateRequest $request)
 {
     $userRepository->update(Auth::user(), $request->all());
     return redirect()->back()->with(['notice' => Lang::get('user.user_updated')]);
 }
開發者ID:Teamelite,項目名稱:Dashboard,代碼行數:12,代碼來源:AccountController.php

示例12: postUpdate

 public function postUpdate(UpdateRequest $request, $id)
 {
     $this->userRepository->update($id, $request->all());
     return responseSuccess('修改成功', 'user/index');
 }
開發者ID:lanzhiwang,項目名稱:laravel-blog,代碼行數:5,代碼來源:UserController.php


注:本文中的App\Repositories\UserRepository::update方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。