File: D:/HostingSpaces/SBogers10/base.komma.pro/vendor/komma/kms/src/Auth/ForgotPasswordController.php
<?php
namespace Komma\KMS\Auth;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Password;
final 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;
use SendsPasswordSetEmails;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Displays a form in which the user can enter his e-mail and press a button
* to request an e-mail which includes the reset password link
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function showLinkRequestForm()
{
return view('KMS::auth.password.email');
}
/**
* Get the broker to be used during password reset.
*
* @return PasswordBroker
*/
public function broker()
{
return Password::broker('kms_users_broker'); //See auth.php
}
/**
* Get the response for a successful password reset link.
*
* @param \Illuminate\Http\Request $request
* @param string $response
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
*/
protected function sendResetLinkResponse(Request $request, $response)
{
switch ($response) {
case PasswordBroker::RESET_LINK_SENT:
$response = trans('KMS::auth.validation.sent');
break;
}
return back()->with('status', $response);
}
/**
* Get the response for a failed password reset link.
*
* @param \Illuminate\Http\Request $request
* @param string $response
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
*/
protected function sendResetLinkFailedResponse(Request $request, $response)
{
$error = '';
switch ($response) {
case PasswordBroker::INVALID_USER:
$error = 'KMS::auth.validation.user';
break;
case PasswordBroker::RESET_THROTTLED:
$error = 'KMS::auth.validation.throttled';
break;
}
return back()
->withInput($request->only('email'))
->withErrors(['email' => trans($error)]);
}
}