首页 文章

Laravel 5.7 Class App \ Http \ Controllers \ Auth \ SendsPasswordResetEmails不存在

提问于
浏览
0

我正在尝试使用Laravel 5.7中的内置函数实现重置密码功能,因为我在 web.php 中定义了我的路由 . 我试过运行 php artisan route:list ,它给了我一个例外

UPDATE

很抱歉缺乏信息 . 我之前已经运行了命令 php artisan make:auth 并且已经在 web.php 中定义了 Auth::routes() 我试图通过我的 ResetPasswordController 访问 ResetPasswords 中的函数 resets 但是它给了一个例外

Class App \ Http \ Controllers \ ResetPasswordController不存在

我正在使用位于App \ Http \ Controllers \ Auth \ ResetPasswor.php的预定义控制器

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

Auth::routes();


Route::post('password/reset','ResetPasswordController@reset');

1 回答

  • 0

    SOLUTION

    我已经弄清楚我在哪里做错了我必须在我的路线中添加 Auth\

    Route::post('password/reset','Auth\ResetPasswordController@reset');
    

相关问题