laravelamazon-s3composer-phpflysystemthephpleague

Uploading files to S3. Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not found


I'm trying to upload files to S3 but I'm getting the error:

Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not found

I have run this command:

composer require league/flysystem-aws-s3-v3:~1.0

I have ran composer update

composer info shows this:

enter image description here

My composer.json shows this:

"require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "larapack/config-writer": "^1.0",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0"
    },

I'm lost. Unsure what is wrong.


Solution

  • You seem to have version 2.0.2 installed. Flysystem was recently re-written, so I think you need to install version 1 for it to be compatible with Laravel (until Laravel updates the underlying version of Flysystem it uses).

    Try running:

    composer require "league/flysystem-aws-s3-v3=^1.0"