Пример #1
0
 public function forgotPassword(Request $request)
 {
     if (\Auth::check()) {
         return redirect('/');
     }
     $userService = new userService();
     $data = array();
     try {
         if ($request->isMethod('post')) {
             $email = $request->input('email', 0);
             if ($userService->forgotPassword($email)) {
                 return redirect('/khach-hang/quen-mat-khau-gui-email?email=' . $email);
             }
         }
         return view('client.customer.forgot-password', $data);
     } catch (\Exception $e) {
         if ($request->ajax()) {
             $result['error'] = $e->getMessage();
             return $result;
         } else {
             return view('errors.404', ['error_message' => $e->getMessage()]);
         }
     }
 }