2014-08-27 146 views
0

IM进行重置密码,即时通讯我的应用程序,以便香港专业教育学院发送电子邮件,当我点击链接即时得到这个错误laravel路线[resetPassword]没有定义

ErrorException 
Route [resetPassword] not defined. (View:C:\wamp\www\happy_Road\app\views\resetPassword.blade.php) 

这里是电子邮件链接

http://localhost/happy_Road/public/index.php/resetPassword/3a62d9105691fb0f09084ffdec7e87bcb9e734c0. 

和路由

Route::get('resetPassword/{token}', function($token) 
{ 
    return View::make('resetPassword')->with('token', $token); 
}); 

所以什么可能是问题!

回答

1

路由本身没有问题,问题是您尝试链接到刀片文件(resetPassword.blade.php)中的路由,但是您尚未给路由命名。请致电Named Routes文档。

这是你需要做什么:

Route::get('resetPassword/{token}', ['as' => 'resetPassword', function($token) 
{ 
    return View::make('resetPassword')->with('token', $token); 
}]); 
+0

它做THX :) – 2014-08-27 09:25:09

0

或者这也可以做

Route::get('resetPassword/{token}', function($token) 
{ 
    return View::make('resetPassword')->with('token', $token); 

})->name('resetPassword'); 
+0

它的工作基于最新的从5.4 Laravel – batuzai04123 2017-05-08 04:56:00