2017-04-11 119 views
0

重置密码后,如何将消息重定向到某条路由消息? 我试图重写redirectTo方法ResetPasswordController,但我得到异常Header may not contain more than a single header, new line detectedLaravel 5.重置密码后重定向消息

public function redirectTo() 
{ 
    return redirect()->route('account')->with(['info_message','Password has been changed']); 
} 

回答

1

redirectTo方法被用来获取路线网址即,它必须是字符串。

对您的情况,您应该覆盖ResetPasswordController中的sendResetResponse

添加以下几行你ResetPasswordController

public function sendResetResponse($response) { 
    return redirect()->route('account')->with(['info_message','Password has been changed']); 
} 
+0

如果您的问题得到解决,那么请接受的答案。 –