php - 标头不能包含多个标头 - 检测到新行
问题描述
标头不能包含多个标头,检测到新行
如何解决?
看法:
@if (Session::has('message-reset-password'))
<div class="alert alert-info">{{ Session::get('message-reset-password') }}</div>
@endif
重置密码控制器:
public function redirectTo(){
if (Auth::check()) {
return redirect('profil')->with('message-reset-password', 'Hasło zostało zmienione.');
} else {
return redirect('login')->with('message-reset-password', 'Hasło zostało zmienione. Można teraz się zalogować.');
}
}
解决方案
方法redirectTo() 不能返回redirect(),它应该总是返回URL 路径
public function redirectTo(){
if (Auth::check()) {
return '/somewhere/someuri';
} else {
return '/somewhere/someotheruri';
}
}
有关它的更多信息:https ://laravel.com/api/5.8/Illuminate/Auth/AuthenticationException.html#method_redirectTo
推荐阅读
- android - 更改下一个活动后应用程序崩溃问题?
- android - setTextAppearance - 尝试禁用单击时不适用于 MaterialButton
- mysql - 为什么 MariaDB 10.1.38 不创建表空间?
- python - 如果我想基于列来处理数据帧,我可以在函数 read_csv 中使用函数“排序依据”吗?
- java - 在我的登录函数中匹配数组列表第二个第三位的值时出错?
- reactjs - 如何在 Twilio Flex 网络聊天中保持聊天栏始终打开
- javascript - 根据 2 个值按多维数组分组
- electron - 在预加载脚本中调用 ipc 通信是一种好方法吗?
- ruby - Nokogiri 是否有理由不解析某个页面上的所有 HTML?(举例)
- c# - 通过C#中的索引号调用类中所有实例的属性?