升级到5.7后,Laravel调用了未定义的方法getOriginalContent

时间:2018-11-09 02:10:48

标签: laravel

所以, 我将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';

我还没有编辑任何供应商文件。那么,这是什么问题?

1 个答案:

答案 0 :(得分:0)

您安装了laravel / telescope吗?此问题已正式修复。您需要更新laravel /望远镜。 https://github.com/laravel/telescope/commit/e4f5c0dd07970fb73fbf79cfa96316b7f91560cf