[英]Laravel 5.7 Class App\Http\Controllers\Auth\SendsPasswordResetEmails does not exist
I'm trying to implement the reset password function using the built-in function from Laravel 5.7 as i have defined my routes in my web.php
. 我正在尝试使用Laravel 5.7中的内置函数来实现重置密码功能,因为我已经在web.php
定义了路由。 I tried running php artisan route:list
, It gave me an exception 我尝试运行php artisan route:list
,这给了我一个例外
UPDATE UPDATE
Sorry for the lack of information given. 抱歉,缺少给出的信息。 I have already ran the command php artisan make:auth
previously and the Auth::routes()
has already been defined in web.php
I am trying to access function resets
in ResetPasswords
traits through my ResetPasswordController
but it gave an exception 我之前已经运行过php artisan make:auth
命令,并且已经在web.php
定义了Auth::routes()
我正在尝试通过我的ResetPasswordController
访问ResetPasswords
特征中的功能resets
,但是它给出了异常
Class App\\Http\\Controllers\\ResetPasswordController does not exist 类App \\ Http \\ Controllers \\ ResetPasswordController不存在
I am using the pre-defined controller that is located at App\\Http\\Controllers\\Auth\\ResetPasswor.php 我正在使用位于App \\ Http \\ Controllers \\ Auth \\ ResetPasswor.php的预定义控制器
ResetPasswordController ResetPasswordController
<?php
namespace App\Http\Controllers\Auth;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
class ResetPasswordController extends Controller
{
use ResetsPasswords;
public function reset(Request $request){
$reset = $this->reset($request);
}
/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}
web.php web.php
Auth::routes();
Route::post('password/reset','ResetPasswordController@reset');
SOLUTION 解
I have figured out where did i do wrong i had to add a Auth\\
in my routes 我已经弄清楚我在哪里做错了,我必须在路线中添加Auth\\
Route::post('password/reset','Auth\ResetPasswordController@reset');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.