laravel - 升级到 5.7 后 Laravel 调用未定义的方法 getOriginalContent
问题描述
所以,我将我的 Laravel 项目从 5.6 升级到了 5.7.13。我在控制器的功能中将此代码作为文件传递方法(以前可以正常工作):
public function sendFile(Request $request)
{
$request->validate([
'path' => 'required|string|min:1|max:256',
]);
return Storage::download($request->path);
}
但现在我得到:
Call to undefined method Symfony\Component\HttpFoundation\StreamedResponse::getOriginalContent()
我已经检查了文件的存在。事实上,这很好用:
if(Storage::exists($request->path)) return 'true';
我没有编辑任何供应商文件。那么,这里有什么问题呢?
解决方案
你安装了 laravel/telescope 吗?此问题已正式修复。你需要更新 laravel/telescope。 https://github.com/laravel/telescope/commit/e4f5c0dd07970fb73fbf79cfa96316b7f91560cf
推荐阅读
- ios - iOS 获取结合多个设备的 healthkit 数据
- wordpress - Aviso 同站点/Aviso 同站点
- ssis - 如何在不使用临时表的情况下使用 SSIS Kingswaysoft 合并源行
- flutter - Flutter - 设计人员/开发人员迭代流程的架构
- javascript - 如何在 vue 中导入 npm 模块?
- angular - 如何在Angular中的同一字段中显示相应类中的字段名称
- reactjs - 如何在 react-navigation 5 中从当前屏幕更新以前的屏幕参数
- asp.net-core - 返回字符串时调用 Http.PostAsync 时应用程序停止工作
- php - 如何使用 mPDF 快速高效地编写大型 PDF?
- makefile - qmake自动生成的Makefile中的混淆变量