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;