Jorge Gallardo
Jorge Gallardo

Reputation: 79

Laravel AWS S3 Adapter class not found

I'm trying to upload files to Amazon s3 using Laravel 5.8, it actually works on locally but I am unable to get it to work online. I got error:

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

I've run 'composer dump-autoload', 'composer install'commands I've even tried to upload vendor folder. The .env file is the same locally and online so I'm pretty sure that is not a credentials problem.

This is my post code:

public function postUpload(StoreImage $request)
    {
        $path = Storage::disk('s3')->put('images/registry', $request->file, 'public');
        $request->merge([
            'size' => $request->file->getClientSize(),
            'path' => $path,
            'auth_by' => $request->patient
        ]);
        $this->image->create($request->only('path', 'title', 'size', 'auth_by'));
        return back()->with('success', 'Image Successfully Saved');
    }

So I'm getting this error:
Error

Please any help would be great :).

Upvotes: 2

Views: 3685

Answers (1)

Weisskopf
Weisskopf

Reputation: 101

You should install AWS adapter package

composer require league/flysystem-aws-s3-v3

Upvotes: 3

Related Questions