Reputation: 2932
I have installed the s3 flysystem package by running the following composer command in my Laravel 8
project
composer require --with-all-dependencies league/flysystem-aws-s3-v3 "^1.0"
and tried to store a file from the request as
$imageName = $request->file('file')->store('uploads');
I got the following error
League\Flysystem\AwsS3v3\AwsS3Adapter::__construct(): Argument #1 ($client) must be of type Aws\S3Client, Aws\S3\S3Client given, called in D:\Projects\Rescale\vendor\laravel\framework\src\Illuminate\Filesystem\FilesystemManager.php on line 229
Upvotes: 4
Views: 9260
Reputation: 221
So it seems ThePHPLeague Flysystem major version got updated (to v2) thus breaking a lot of stuff since latest Laravel depends on "^1.1" (see: https://github.com/laravel/framework/blob/8.x/composer.json#L27).
I've had this error, so my workaround is to use a specific version instead.
- "league/flysystem-aws-s3-v3": "^1.0",
+ "league/flysystem-aws-s3-v3": "1.0.29",
composer update
and let composer update your dependencies.Upvotes: 22