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 ResetPasswordController
but 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');
SendsPasswordResetEmails
in your Auth folder check this – Alexander Villalobosphp 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 beAuth\ForgotPasswordController
andAuth\ResetPasswordController
– Das