2
votes

I'm trying to link a button in a user account page so they can reset their password. I created a form with the url /password/reset and pass along the email of the user but to see how the routes look for showing the reset password form when I run the command

php artisan route:list

I get the error

Class App\Http\Controllers\ResetPasswordController does not exist

I tried remaking auth by php artisan make:auth but this didn't solve the problem. Why would it be thinking the controller isn't in app/http/Controllers/Auth/? Why am I getting this error?

2
You don't need create any routes or views since it's all will be done for you when you the the make:auth command. remove any route and and view you have created for the reseting the password and go to localhost:8000 You will get login and register links out of the box provided by laravel if you click the login link you wiil get a login form and a reset password linkAmr Aly
Thanks but I already know all that. That doesn't help me because the users need to be able to do this through their account. Why wouldn't I even be able to use php artisan route:list ? It's throwing an error and that shouldn't happenRichard
Can you show us your route registrations? Are you using Route::auth()?sisve

2 Answers

0
votes

please check your controller and route.php file there could be syntax error

0
votes

I got this error because the class's namespace declaration didn't match the path of the file. It was:

namespace App\Http\Controllers\Api\Auth;

While the file path was:

App\Http\Controllers\Auth\ResetPasswordController.php;

The Auth folder wasn't inside the Api folder so I either had to move the folder to there or change the namespace declaration to:

namespace App\Http\Controllers\Auth;