Файл: app/Http/Controllers/Auth/ForgotPasswordController.php
Строк: 78
<?php
namespace AppHttpControllersAuth;
use AppHttpControllersController;
use IlluminateFoundationAuthSendsPasswordResetEmails;
use IlluminateHttpRequest;
use IlluminateSupportFacadesPassword;
class ForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/
use SendsPasswordResetEmails;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Send a reset link to the given user.
*
* @param IlluminateHttpRequest $request
* @return IlluminateHttpRedirectResponse|IlluminateHttpJsonResponse
*/
public function sendResetLinkEmail(Request $request)
{
try {
$this->validateEmail($request);
// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// need to show to the user. Finally, we'll send out a proper response.
$response = $this->broker()->sendResetLink(
$this->credentials($request)
);
return $response == Password::RESET_LINK_SENT
? $this->sendResetLinkResponse($request, $response)
: $this->sendResetLinkFailedResponse($request, $response);
} catch (Exception $e) {
return redirect()->back()->with('error', $e->getMessage());
}
}
}