0
votes

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. I tried running php artisan route:list , It gave me an exception

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 ResetPasswordControllerbut it gave an exception

Class App\Http\Controllers\ResetPasswordController does not exist

I am using the pre-defined controller that is located at 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
error say dont find SendsPasswordResetEmails in your Auth folder check thisAlexander Villalobos
check the namespace of your missing class is correct toodelboy1978uk
Have you ran php artisan make:auth to let Laravel generate these classes? According to this Also make sure you are calling the right classes, unless you have made some custom ones, they should be Auth\ForgotPasswordController and Auth\ResetPasswordControllerDas

1 Answers

1
votes

SOLUTION

I have figured out where did i do wrong i had to add a Auth\ in my routes

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