1
votes

When I attempt to reset a users password I run into a fatal error once the form filled and posted to /password/email

I'm running Laravel 5.2

ReflectionException in Container.php line 738: Class auth.password does not exist

All of my views are in place and password_resets exists in the database.

NOTE: this fatal error only occurs when the user fills out the "reset password email form" and hits submit.

Here is the password controller, which is a stock controller.

<?php

 namespace App\Http\Controllers\Auth;

 use Auth;
 use App\Http\Controllers\Controller;
 use Illuminate\Foundation\Auth\ResetsPasswords;

 class PasswordController extends Controller
 {
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/

use ResetsPasswords;

/**
 * Create a new password controller instance.
 *
 * @return void
 */
public function __construct()
{
    $this->middleware('guest');
}
 }

Update: Route

Route::controllers([
'password' => 'Auth\PasswordController',
 ]);
2
share your routs file please , add route::auth(); to your routes fileAchraf Khouadja
@AchrafKhouadja Updated.TheRealJAG
try to remove that and add Route::auth(); insite a route groupe that have a web middlware (i heard its dropped in recent versions but give it a shot) route::auth is a shortcut for all auth routes (check my answer)Achraf Khouadja
@AchrafKhouadja Tried that and it threw an error.TheRealJAG
can you put this as answered and tell us what was the probleme (i checked the link you gave me and it works fine now)Achraf Khouadja

2 Answers

1
votes

This is how you can do it

routes.php

Route::get  ('password/email', 'Auth\PasswordController@getEmail');
Route::post('password/email', 'Auth\PasswordController@postEmail');

// Password reset routes...
   Route::get('password/reset/{token}', 'Auth\PasswordController@getReset');
  Route::post('password/reset', 'Auth\PasswordController');
0
votes

Its seems auth is missing, You can simply run this command:

php artisan make:auth