Error on S3 Uploading - Laravel 5

Posted 3 years ago by rtechshow

Hello I am using s3 to upload images and i am getting the error like below. Please help

FatalErrorException in FilesystemManager.php line 140:
Class 'League\Flysystem\AwsS3v2\AwsS3Adapter' not found

My Composer require

"require": {
        "laravel/framework": "5.0.*",
        "illuminate/html": "~5.0",
        "greggilbert/recaptcha": "2.*",
        "guzzlehttp/guzzle": "~6.0",
        "pda/pheanstalk": "3.0.2",
        "league/flysystem-aws-s3-v2": "~1.0"
},

I configuered s3 properly in filesystem

My Controller Code

use Illuminate\Contracts\Filesystem\Filesystem;
.........................................
 $pic = $request->file('pic');
        $picName = $user->activation_code . '.' . $pic->getClientOriginalExtension();
        
        $s3 = \Storage::disk('s3');
        $pickPath = '/'.$user->username.'/' . $picName;
        $s3->put($pickPath, file_get_contents($pic), 'public');
        

Please tell me where i am doing mistakes. Thanks

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

Reply to

Use Markdown with GitHub-flavored code blocks.