0

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');
  • error say dont find `SendsPasswordResetEmails` in your Auth folder check this – Alexander Villalobos Oct 02 '18 at 14:48
  • check the namespace of your missing class is correct too – delboy1978uk Oct 02 '18 at 14:48
  • Have you ran `php artisan make:auth` to let Laravel generate these classes? According to [this](https://laravel.com/docs/5.7/passwords#resetting-routing) Also make sure you are calling the right classes, unless you have made some custom ones, they should be `Auth\ForgotPasswordController` and `Auth\ResetPasswordController` – Das Oct 02 '18 at 14:54

1 Answers1

1

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');