Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not found (Laravel + Heroku)

Viewed 44572

connect my laravel 5.4 application in heroku with aws s3 to save and display images that I upload with a dashboard.

In local I have no problem with uploading and viewing the images, even these are stored in the bucket I made. But when I set up aws in heroku to do tests there, I get the error: Class 'League\Flysystem\AwsS3v3\AwsS3Adapter'

I already removed and reinstalled the package from composer, I do not know why the error does not appear in my local environment.

thank you very much.

7 Answers

you forgot to install the required library

composer require league/flysystem-aws-s3-v3

good luck

For laravel 8 use

 composer require --with-all-dependencies league/flysystem-aws-s3-v3 "^1.0"

I solved mine with

composer require guzzlehttp/psr7 "1.8.1"

to first downgrade from version 2.0.0 as the was sdk package doesn't yet support version 2.0.0.. then

composer require league/flysystem-aws-s3-v3 "~1.0" --update-with-all-dependencies

For me I had the same issue and tried many solutions but nothing worked with me. Finally I found out that flysystem-aws-s3-v2 is in composer.lock although I was using flysystem-aws-s3-v3 with the command: composer require league/flysystem-aws-s3-v3 which doesn't change anything in composer.lock so what I did is that I removed vendor folder and composer.lock file and run composer install and that solved the problem for me.

According to Laravel docs:

https://laravel.com/docs/8.x/filesystem

You need this dependancy

composer require --with-all-dependencies league/flysystem-aws-s3-v3 "^1.0"

My case was a bit tougher, I had to upgrade a couple of related dependencies in order to have it up and running. Mainly I upgraded aws/aws-sdk-php to the version the composer mentioned when I ran: composer require --with-all-dependencies league/flysystem-aws-s3-v3 "^1.0".

Related