当前位置: 首页>>代码示例>>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;未经允许,请勿转载。