Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Drfraker's avatar

Flysystem Setup

I'm trying to get the Flysystem set up in L5 and I'm having a difficult time with it. I'm getting this error and don't know why.

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

When I watched the video that Jeffrey did it didn't require an more setup other than pulling in the sdk from amazon. Link to that video: https://laracasts.com/series/whats-new-in-laravel-5/episodes/6#

However when I go to the flysystem for laravel 5 page on github it is saying that we need to pull in a different version of flysystem and publish the contents of the config for that package. Link to that github page: https://github.com/GrahamCampbell/Laravel-Flysystem

So I'm confused as to what to do and why I'm getting this error.

0 likes
5 replies
Drfraker's avatar

Just in case anyone else is having this problem. You have to include the amazon s3 adapter for the flysystem to work in laravel 5. It states this clearly in the L5 docs. I just didn't bother to read there first because Jeffrey didn't say anything about it in the original screencast.

9 likes
brandonschatz's avatar

Thanks for writing this. I required: aws/aws-sdk-php after watching an older video and received the same error.

After just a few days of using Laravel, I'm pretty much in love. :-)

MutantMahesh's avatar

Thanks for sharing this. Yes you have to install laravel-flysystem and aws-sdk-php-laravel packages. To upload files to s3 with laravel 5 you can follow these steps:

composer require aws/aws-sdk-php-laravel:~2.0
composer require graham-campbell/flysystem:~2.1
composer require league/flysystem-aws-s3-v2:~1.0

and add service provider and alias in config.php according to specified in package documentation from here: https://github.com/aws/aws-sdk-php-laravel/tree/2.0.1 https://github.com/GrahamCampbell/Laravel-Flysystem/tree/v2.1.1

Please or to participate in this conversation.