middleware('guest'); } /** * Send a reset link to the given user. * * @param \Illuminate\Http\Request $request * * @return \Illuminate\Http\Response */ public function sendResetLinkEmail(Request $request) { $this->validate($request, ['email' => 'required|email']); $user = User::whereEmail($request->get('email'))->first(); if (!is_null($user) && intval($user->blocked) === 1) { $response = 'passwords.blocked'; } else { $response = Password::sendResetLink( $request->only('email'), function (Message $message) { $message->subject($this->getEmailSubject()); } ); } switch ($response) { case Password::RESET_LINK_SENT: return $this->getSendResetLinkEmailSuccessResponse($response); case Password::INVALID_USER: case 'passwords.blocked': default: return $this->getSendResetLinkEmailFailureResponse($response); } } }