SergioGregorutti
4 years ago

Error trying to upload a file on Amazon S3

Posted 4 years ago by SergioGregorutti

Hi all,

Im trying to upload an image to an Amazon S3 bucket but Im dealing with this error:

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

In my composer.json file I have:

...
"league/flysystem-aws-s3-v2": "~1.0",
"aws/aws-sdk-php-laravel": "~2.0",
"graham-campbell/flysystem": "~2.1"

An in the controller:

...
    $file = time().'-'.$image->getClientOriginalName();
    $path = 'images/commerces/'.$commerce->id.'/';

        $image = Image::make($image)->widen(800, function ($constraint) {
            $constraint->upsize();
        });
        //$image->save($path . $image);

        Storage::disk('s3')->put($path.$file, $image);

        $commerce->image = $file;
        $commerce->save();
...

Someone can help me with this?

Thanks in advance!

Please sign in or create an account to participate in this conversation.