【发布时间】:2021-04-16 05:07:05
【问题描述】:
我已经安装了这两个包
"league/flysystem": "^2.0",
"league/flysystem-aws-s3-v3": "^2.0"
在app/bootstrap.php文件中添加了这些代码
$app->singleton('filesystem', function ($app) {
return $app->loadComponent(
'filesystems',
Illuminate\Filesystem\FilesystemServiceProvider::class,
'filesystem'
);
});
$app->register(Illuminate\Filesystem\FilesystemServiceProvider::class);
还注册了配置文件filesystems.php
$app->configure('filesystems');
spaces 配置在filesystems.php
'spaces' => [
'driver' => 's3',
'key' => env('DO_SPACES_KEY'),
'secret' => env('DO_SPACES_SECRET'),
'endpoint' => env('DO_SPACES_ENDPOINT'),
'region' => env('DO_SPACES_REGION'),
'bucket' => env('DO_SPACES_BUCKET'),
]
我想从存储中读取文件
$file = Storage::disk('spaces')->get($existing_path);
现在我收到此错误
【问题讨论】:
-
您可以尝试删除您的供应商文件夹并运行
composer install吗? -
试过但没用@Eden Moshe
标签: php laravel amazon-s3 filesystems lumen