移動面向auth控制器我Http/Controllers/Admin/Auth
目錄,以及移動的觀點是面向auth到admin/auth
並設置路由後的文件是這樣的:Laravel 5.3 - 復位修改密碼身份驗證路線
Route::group(['middleware' => 'web', 'prefix' => 'admin', 'namespace' => 'Admin'], function() {
Auth::routes();
});
當點擊該鏈接在重置密碼電子郵件,我得到一個錯誤:
NotFoundHttpException in RouteCollection.php line 161:
我已經修改showResetForm方法在控制器中,像這樣:
public function showResetForm(Request $request, $token = null)
{
return view('admin.auth.passwords.reset')->with(
['token' => $token, 'email' => $request->email]
);
}
這是上php artisan route:list
列出的路線:
POST | admin/password/email | | App\Http\Controllers\Admin\Auth\[email protected] | web,web,guest |
| | POST | admin/password/reset | | App\Http\Controllers\Admin\Auth\[email protected] | web,web,guest |
| | GET|HEAD | admin/password/reset | | App\Http\Controllers\Admin\Auth\[email protected] | web,web,guest |
| | GET|HEAD | admin/password/reset/{token} | | App\Http\Controllers\Admin\Auth\[email protected] | web,web,guest |
| | GET|HEAD | admin/register | | App\Http\Controllers\Admin\Auth\[email protected] | web,web,guest |
| | POST | admin/register | | App\Http\Controllers\Admin\Auth\[email protected] | web,web,guest
,用戶接收郵件的密碼重置仍然是指向沒有Admin前綴老路線的鏈接,我怎樣才能改變這種狀況?
對於任何希望根據路由名稱生成url的用戶,可以使用:route('password.reset',['token'=> {your token}]) –