get('email'); if (config('captcha.enabled') == false) { $v = validator($request->all(), [ 'email' => 'required', ]); } else { $v = validator($request->all(), [ 'email' => 'required', 'captcha' => 'hiddencaptcha', ]); } if ($v->fails()) { return redirect()->route('username.request') ->withErrors($v->errors()); } $user = User::where('email', '=', $email)->first(); if (empty($user)) { return redirect()->route('username.request') ->withErrors(trans('email.no-email-found')); } //send username reminder notification $user->notify(new UsernameReminder()); return redirect()->route('login') ->withSuccess(trans('email.username-sent')); } }