對laravel密碼提醒有疑問。Laravel密碼提醒
我可以得到RemindersController控制器通過電子郵件從postRemind方法的鏈接。
當我點擊復位郵件鏈路上(
http://localhost/projects/mylaravelproject/public/password/reset/d3f0480aa46baa4a8ae23770509b1dc6b6ca3cbf
)
我得到這個錯誤:的Symfony \元器件\ HttpKernel \異常\ NotFoundHttpException
作爲結論,我在嘗試達到reset.blade頁時遇到問題。
<form action="{{ action('[email protected]') }}" method="POST"> <input type="hidden" name="token" value="{{ $token }}"> <input type="email" name="email"> <input type="password" name="password"> <input type="password" name="password_confirmation"> <input type="submit" value="Reset Password"> </form>
- 這是我的routes.php文件的文件:
4.
Route::get('/', function() { return View::make('pages.home'); }); //routes to home page when an inner call incomes from the main menu Route::get('home', [ 'as' => 'home', function(){ return View::make('pages.home'); } ]); //routes to about page Route::get('about', [ 'as' => 'about', function(){ return View::make('pages.about'); } ]); //routes to login page Route::any('login', [ 'as' => 'login', function(){ return View::make('pages.login'); } ]); //Routes to forgot password page Route::any('remindPassword', [ 'as' => 'password.remind', function(){ return View::make('password.remind'); } ]); //Forgot Password Post Controller Route::post('password.remind', [ 'uses' => '[email protected]', 'as' => 'password.remind.postRemind' ]); //Routes to register page Route::any('register', [ 'as' => 'register', function(){ return View::make('pages.register'); } ]); //Registration Post Controller Route::post('register', array( 'uses' => '[email protected]', 'as' => 'registration.store' )); Route::post('login', array( 'uses' => '[email protected]', 'as' => 'session.store' )); Route::get('logout', array( 'uses' => '[email protected]', 'as' => 'session.destroy' ));
在此先感謝。
您是否將'password/reset/{token}'路線映射到提醒控制器的正確方法? – Luceos 2014-09-25 07:13:37
RemindersController中的getReset方法有一個令牌和路由,如果我沒有錯的話。像這樣在getReset方法中,我有這樣一行:返回View :: make('password.reset') - > with('token',$ token);我有這個網頁下的意見/密碼/提醒 – 2014-09-25 07:22:37
在你的HTML嘗試而不是行動'route('password.remind.postRemind')' – Luceos 2014-09-25 07:50:22