任何人都知道爲何路由「/ password/email」在生產服務器上返回404 Not Found錯誤,但適用於本地?Laravel 5 - 無法在生產服務器上重置密碼404 - 未找到
當用戶試圖通過電子郵件(https://compariimobiliare.ro/password/reset)重置密碼時,POST URL https://compariimobiliare.ro/password/email會給出404 Not Found錯誤。相同的URL在本地服務器上正常工作,但不在生產中。
路線是存在的,我能看到它,當我運行命令:
php artisan route:list
POST | password/email | | App\Http\Controllers\Auth\[email protected] | web,guest
Laravel默認的實現:
public function sendResetLinkEmail(Request $request)
{
$this->validate($request, ['email' => 'required|email']);
// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// need to show to the user. Finally, we'll send out a proper response.
$response = $this->broker()->sendResetLink(
$request->only('email')
);
if ($response === Password::RESET_LINK_SENT) {
return back()->with('status', trans($response));
}
// If an error was returned by the password broker, we will get this message
// translated so we can notify a user of the problem. We'll redirect back
// to where the users came from so they can attempt this process again.
return back()->withErrors(
['email' => trans($response)]
);
}
你可以在控制器'ForgotPasswordController'中顯示'sendResetLinkEmail'方法的代碼嗎? – KuKeC