В моем проекте laravel я пытаюсь реализовать функцию забывания пароля. Я успешно получил электронное письмо для сброса пароля, но когда я отправляю эту форму, которая содержит новый пароль, она генерирует эту ошибку Target class [App\Http\Controllers\User\UserAuth\ResetPassswordController] does not exist.
Но есть ResetPassswordController.php
именованный файл по указанному пути.
Ниже приведен код Resetpasswordcontroller. php
<?php
namespace App\Http\Controllers\User\UserAuth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Password;
use Illuminate\Http\Request;
use JsValidator;
class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
/**
* Where to redirect users after login / registration.
*
* @var string
*/
public $redirectTo = '/user/dashboard';
protected $validationRules = [
'name' => 'required|max:255',
'email' => 'required|email|max:255',
'password' => 'required|min:6|confirmed',
];
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
// $this->middleware('user.guest');
}
/**
* Display the password reset view for the given token.
*
* If no token is present, display the link request form.
*
* @param \Illuminate\Http\Request $request
* @param string|null $token
* @return \Illuminate\Http\Response
*/
public function showResetForm(Request $request, $token = null)
{
$validator = JsValidator::make($this->validationRules,[],[],'#resetform');
return view('user.auth.passwords.reset')->with(
['token' => $token, 'email' => $request->email, 'validator' => $validator]
);
}
/**
* Get the broker to be used during password reset.
*
* @return \Illuminate\Contracts\Auth\PasswordBroker
*/
public function broker()
{
return Password::broker('users');
}
/**
* Get the guard to be used during password reset.
*
* @return \Illuminate\Contracts\Auth\StatefulGuard
*/
protected function guard()
{
return Auth::guard('user');
}
}
Ниже приведен код в маршрутах (web. php)
Route::get('/', 'User\UserAuth\LoginController@showLoginForm')->name('login');
Route::get('/register', 'User\UserAuth\LoginController@showLoginForm')->name('register');
Route::post('user/login', 'User\UserAuth\LoginController@login')->name('postLogin');
Route::post('user/logout', 'User\UserAuth\LoginController@logout')->name('logout');
Route::get('user/password/reset', 'User\UserAuth\ForgotPasswordController@showLinkRequestForm')->name('password.reset');
Route::post('user/password/email', 'User\UserAuth\ForgotPasswordController@sendResetLinkEmail')->name('password.reequest');
Route::post('user/password/reset', 'User\UserAuth\ResetPassswordController@reset')->name('password.email');
Route::get('user/password/reset/{token}', 'User\UserAuth\ResetPasswordController@showResetForm');
Ниже приведен код отправки формы, который содержит новый пароль
<form class="" role="form" method="POST" action="{{ url('/user/password/reset') }}" id="resetform">
В чем проблема?