Lumen 8.x filesystem not working. Error: Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not found
Lumen 8.x filesystem not working. Error: Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not found
我已经安装了这两个包
"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.json
中删除了 "aws/aws-sdk-php": "3.0"
和 "league/flysystem-aws-s3-v3": "~1.0"
、“league/flysystem-cached-adapter": "1.0"
和运行composer require league/flysystem-aws-s3-v3
我已经安装了这两个包
"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);
现在我收到这个错误
来自这个
"aws/aws-sdk-php": "3.0"
和 "league/flysystem-aws-s3-v3": "~1.0"
、“league/flysystem-cached-adapter": "1.0"
和运行composer require league/flysystem-aws-s3-v3