Esempio n. 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');
 }
Esempio n. 2
0
 public function updatePassword(UpdatePasswordRequest $request, User $user)
 {
     $user->password = $request->get('password');
     $user->save();
     $message = 'The password was updated successfully !';
     Log::info($message, $user->toArray());
     $this->notifySuccess($message, 'Password Updated !');
     return redirect()->route('auth::foundation.profile.index');
 }
Esempio n. 3
0
 /**
  * Delete a user.
  *
  * @param  \Arcanesoft\Contracts\Auth\Models\User  $user
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function delete(User $user)
 {
     self::onlyAjax();
     $this->authorize(UsersPolicy::PERMISSION_DELETE);
     try {
         if ($user->trashed()) {
             $user->forceDelete();
             $message = "The user {$user->username} has been successfully deleted !";
             Log::info($message, $user->toArray());
         } else {
             $user->delete();
             $message = "The user {$user->username} was placed in trashed users !";
         }
         $this->notifySuccess($message, 'User deleted !');
         $ajax = ['status' => 'success', 'message' => $message];
     } catch (\Exception $e) {
         $ajax = ['status' => 'error', 'message' => $e->getMessage()];
     }
     return response()->json($ajax);
 }