Getting Started

Installation

Flysystem can be installed using composer.

composer require league/flysystem:^3.0

Additionally, you may want to install an extra adapter to interact with specific types of filesystems. You can find the adapters in the menu.

General usage

To safely interact with the filesystem, always wrap the adapter in a Filesystem instance. You can read more about why in the information about the architecture.

// SETUP
$adapter = new League\Flysystem\Local\LocalFilesystemAdapter($rootPath);
$filesystem = new League\Flysystem\Filesystem($adapter);

// USAGE
$filesystem->write($path, $contents);