【发布时间】:2022-09-29 12:48:17
【问题描述】:
我们已将 laravel/framework 更新到 ^9.0 版本,将 League/flysystem 更新到 ^3.0。
现在我们有以下错误:
Call to undefined method League\\Flysystem\\Filesystem::put()
我们的代码:
Storage::disk(\'disk-name\')->put($concept->id.\'.docx\', file_get_contents($tmpPath));
在 flysystem 升级指南中,他们说: https://flysystem.thephpleague.com/docs/upgrade-from-1.x/
那个 put() 变成了 write() 方法。
当我查看他们使用的 flysystem 源代码时:
vendor/league/flysystem/src/Filesystem.php
public function write(string $location, string $contents, array $config = []): void
但是当我查看 Laravel 9 Storage 外观时,他们仍然使用:
applications/kics/vendor/laravel/framework/src/Illuminate/Support/Facades/Storage.php
put
同样在 laravel 9 文档中,他们展示了他们建议使用 put 方法的示例。 https://laravel.com/docs/9.x/filesystem#obtaining-disk-instances
有谁知道如何解决这个问题?
谢谢!
`