问题描述
我在流明中遇到了这个错误
Hi I got this errors in Lumen
在RedirectResponse.php第75行
in RedirectResponse.php line 75
在RegistersExceptionHandlers.php第55行的Application-> handleShutdown()中
at Application->handleShutdown() in RegistersExceptionHandlers.php line 55
在应用程序-> Laravel \ Lumen \ Concerns {closure}()
at Application->Laravel\Lumen\Concerns{closure}()
这是引发错误的代码:
return redirect('formular')
->withErrors($validator)
->withInput();
错误来自Input()
The error comes from withInput()
推荐答案
由于Lumen 5.2不支持会话,因此发生了错误. withErrors()
和withInput()
方法尝试在重定向器的session
属性上设置值,但session
属性为null.
The error is happening because Lumen 5.2 does not support sessions. The withErrors()
and withInput()
methods attempt to set values on the session
attribute on the redirector, but the session
attribute is null.
基本上,如果您尝试使用会话,则尝试以非预期的方式使用Lumen 5.2.您应该使用Lumen 5.1,或者使用完整的Laravel框架.您可以在此处阅读有关流明5.2理念更改的发行说明.
Basically, if you're trying to use sessions, you're trying to use Lumen 5.2 in a way it was not intended. You should either be using Lumen 5.1, or using the full Laravel framework. You can read the release notes here on the philosophy change for Lumen 5.2.
这篇关于RedirectResponse.php 75行中的Lumen FatalErrorException:在null上调用成员函数flashInput()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!