![](/img/trans.png)
[英]FatalErrorException in routes.php line 113: Call to a member function delete() on null in Laravel 5.2
[英]Lumen FatalErrorException in RedirectResponse.php line 75: Call to a member function flashInput() on null
嗨,我在流明有這個錯誤
RedirectResponse.php 75行中的FatalErrorException:在null上調用成員函數flashInput()
在RedirectResponse.php第75行
在RegistersExceptionHandlers.php第55行的Application-> handleShutdown()中
在Application-> Laravel \\ Lumen \\ Concerns {closure}()
這里的代碼引發錯誤:
return redirect('formular')
->withErrors($validator)
->withInput();
錯誤來自withInput()
由於Lumen 5.2不支持會話,因此發生了錯誤。 withErrors()
和withInput()
方法嘗試在重定向器的session
屬性上設置值,但是session
屬性為null。
從有關驗證的Lumen 5.2文檔中 :
Lumen不支持開箱即用的會話,因此Laravel中每個視圖中可用的
$errors
視圖變量在Lumen中不可用。 驗證失敗時,$this->validate
幫助器將始終返回帶有相關錯誤消息的JSON響應。 如果您不構建僅發送JSON響應的無狀態API,則應使用完整的Laravel框架。
基本上,如果您嘗試使用會話,則嘗試以一種不希望的方式使用Lumen 5.2。 您應該使用Lumen 5.1,或者使用完整的Laravel框架。 您可以在此處閱讀有關Lumen 5.2理念變更的發行說明 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.