public function postPasswordReset(UserRepository $userRepository) { $rules = ['email' => 'email|required']; $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } $email = Input::get('email'); $user = User::where('email', '=', $email)->first(); if (empty($user)) { return redirect()->back()->withErrors(['User with this email does not exist']); } $userRepository->resetPassword($user); return redirect()->back()->with('status', 'success')->with('message', 'Check your inbox!'); }
public function postVerify(UserRepository $userRepository) { $rules = ['email' => 'email|required']; $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } $email = Input::get('email'); $user = User::where('email', '=', $email)->first(); if (empty($user)) { return redirect()->back()->with('status', 'danger')->with('message', 'User with this email does not exist!'); } elseif ($user->confirmed == 1) { return redirect()->route('auth.login')->with('status', 'success')->with('message', 'User already Verified. Please Login.'); } $userRepository->resendVerify($user); return redirect()->back()->with('status', 'success')->with('message', 'Check your inbox!'); }