Laravel "League\Flysystem ... not installed" driver in CI
Laravel builds a storage disk through Flysystem. Each driver (s3, ftp, sftp) needs its adapter package. If a test or command uses a disk whose adapter is not installed, Laravel throws "Please install the ... Flysystem adapter." Add the adapter or use the local/fake disk in tests.
What this error means
A Storage::disk('s3') call fails with "InvalidArgumentException: Please install the AWS S3 Flysystem adapter (composer require league/flysystem-aws-s3-v3)."
InvalidArgumentException
Please install the AWS S3 Flysystem adapter:
composer require league/flysystem-aws-s3-v3 "^3.0"Common causes
The adapter package is not installed
The disk driver in config/filesystems.php needs a specific Flysystem adapter that composer.json does not require, so building the disk fails.
Tests exercise a cloud disk directly
A test uses the real S3 disk instead of a fake, so it needs the adapter (and credentials) that CI lacks.
How to fix it
Install the required adapter
- Read which adapter the exception names.
- Require it in composer so the disk can be built.
- Re-run the command or test.
composer require league/flysystem-aws-s3-v3 "^3.0"Fake the disk in tests
Use Storage::fake() so tests use an in-memory disk and need no cloud adapter or credentials.
use Illuminate\Support\Facades\Storage;
Storage::fake('s3');How to prevent it
- Require the Flysystem adapter for every disk you use.
- Use
Storage::fake()in tests instead of real cloud disks. - Keep the default disk to local in the testing env.