Beispiel #1
0
 public function updatePassword(UpdatePasswordRequest $request, User $user)
 {
     $user->update(['password' => $request->get('password')]);
     Log::info($message = 'The password was updated successfully !', $user->toArray());
     $this->notifySuccess($message, 'Password Updated !');
     return redirect()->route('admin::auth.profile.index');
 }
Beispiel #2
0
 /**
  * Update the user.
  *
  * @param  \Arcanesoft\Auth\Http\Requests\Backend\Users\UpdateUserRequest  $request
  * @param  \Arcanesoft\Contracts\Auth\Models\User                          $user
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function update(UpdateUserRequest $request, User $user)
 {
     $this->authorize(UsersPolicy::PERMISSION_UPDATE);
     $inputs = ['username', 'email', 'first_name', 'last_name'];
     if ($request->has('password')) {
         $inputs[] = 'password';
     }
     $user->update($request->only($inputs));
     $user->roles()->sync($request->get('roles'));
     $message = "The user {$user->username} was updated successfully !";
     Log::info($message, $user->toArray());
     $this->notifySuccess($message, 'User Updated !');
     return redirect()->route('auth::foundation.users.show', [$user->hashed_id]);
 }