Laravel cannot find League\Flysystem\AwsS3v3\AwsS3Adapter
Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not foundShort answer
The S3 adapter package is missing, or your code names the class from an older Flysystem. Laravel 12 works with Flysystem 3, which needs league/flysystem-aws-s3-v3 at ^3.0, and its adapter is called AwsS3V3Adapter. Install the matching package and update any code that still uses the old name.
Fix it fast
1Find out which cause you have
See which Flysystem packages are installed and where the old class name is used.
composer show 'league/flysystem*' grep -rn "AwsS3Adapter" app config2Match what you see, then jump to its fix
- 1
composer show lists no league/flysystem-aws-s3-v3, or lists a 1.x version next to flysystem 3The S3 package is not installed, or is on an old major versionFix - 2
grep finds AwsS3Adapter or the AwsS3v3 namespace in your own code or in a package that is out of dateCustom code still names the old adapter classFix
- 1
What does the error look like?
Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not found
Cause 1 of 2
The S3 package is not installed, or is on an old major version
1Check
Laravel's S3 disk needs the Flysystem S3 package. The Flysystem upgrade notes say adapters must be upgraded together with the core package.
composer show league/flysystem-aws-s3-v32Fix
Install the package at the version Laravel documents, letting Composer update the packages that depend on it.
composer require league/flysystem-aws-s3-v3 "^3.0" --with-all-dependencies3Verify
The package shows version 3.x.
composer show league/flysystem-aws-s3-v3Confirmed by laravel.com
Cause 2 of 2
Custom code still names the old adapter class
1Check
The current package documents its adapter as League\Flysystem\AwsS3V3\AwsS3V3Adapter. Use that name in code you control.
grep -rn "AwsS3v3\\\\AwsS3Adapter" app config vendor/*/ --include=*.php -l2Fix
Change the import and the construction to the current class. For the normal s3 disk in config/filesystems.php, do not build the adapter yourself: let Laravel create it.
use League\Flysystem\AwsS3V3\AwsS3V3Adapter;3Verify
Clear the cached config and repeat the action that failed.
php artisan config:clearConfirmed by flysystem.thephpleague.com
How do I stop it coming back?
- Install the S3 package when you enable the s3 disk, using the command from the Laravel docs.
- Prefer the s3 disk in config/filesystems.php over building adapters by hand.
- Run composer outdated after a framework upgrade to catch packages that still target the old Flysystem.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- Spotless LaundryAn on-demand laundry app: Flutter on a Laravel back end, with Firebase for live updates.
- EZ EstimaterConstruction quoting and job tracking for contractors, on a Laravel and Firebase stack.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
Related fixes
Back end
AWS SDK for PHP cannot get credentials from the instance profile metadata server
Error retrieving credentials from the instance profile metadata server.
The SDK tries the EC2 instance metadata service when it has no valid credentials from anywhere earlier in its chain.
4 causes, each with a fixBack end
AWS SDK for PHP rejects requests: the signature is from the future
Signature not yet current: {date} is still later than {date}
AWS compares the timestamp in your signed request with its own clock.
2 causes, each with a fixBack end
Composer says the gd extension is missing on a Laravel project
composer install or composer update stops on a package that requires ext-gd
Composer refuses to install a package that requires ext-gd when the PHP binary running Composer has no GD extension.
4 causes, each with a fixBack end
composer require maatwebsite/excel fails to install
Composer says the package needs an older PHP than the one installed
Composer refuses maatwebsite/excel when the PHP version or a PHP extension does not match what the package and PhpSpreadsheet need.
3 causes, each with a fixBack end
composer install says the lock file is not compatible and asks for update
Your lock file does not contain a compatible set of packages. Please run composer update.
composer install checked the locked packages against this machine's PHP and extensions and found a conflict.
3 causes, each with a fixBack end
composer require laravel/horizon fails: ext-pcntl is missing
laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system
Horizon needs the pcntl extension, and Composer refuses to install it where PHP lacks that extension.
3 causes, each with a fix