Laravel 5 - 无法在生产服务器404上重置密码 - 未找到

时间:2017-03-06 13:13:58

标签: laravel routes http-status-code-404 password-recovery

任何人都知道为什么路线' /密码/电子邮件'在生产服务器上返回404 Not Found错误,但在本地工作?

当用户尝试通过电子邮件重置密码(https://compariimobiliare.ro/password/reset)时,POST网址https://compariimobiliare.ro/password/email会显示404 Not Found错误。相同的URL在本地服务器上工作正常,但在生产时不能正常工作。

路线在那里,我可以在运行命令时看到它:

php artisan route:list

POST | password/email | | App\Http\Controllers\Auth\ForgotPasswordController@sendResetLinkEmail | web,guest 

enter image description here

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)]
        );
    }

1 个答案:

答案 0 :(得分:1)

我可以看到你有密码/电子邮件的POST路由。 你有密码/电子邮件的GET路线吗? 您将获得404,因为它正在尝试访问GET路由。