1. Go to this page and download the library: Download minhyung/flysystem-mybox library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
minhyung / flysystem-mybox example snippets
use League\Flysystem\Filesystem;
use Minhyung\Flysystem\Mybox\MyboxAdapter;
use Minhyung\Mybox\MyboxClient;
$filesystem = new Filesystem(new MyboxAdapter(MyboxClient::create($_ENV['MYBOX_PAT'])));
$filesystem->write('reports/2026-08.csv', $csv);
echo $filesystem->read('reports/2026-08.csv');
$adapter = new MyboxAdapter($client, 'app-data/uploads');
use Minhyung\Flysystem\Mybox\Enum\DeletionMode;
use Minhyung\Flysystem\Mybox\MyboxAdapterOptions;
$adapter = new MyboxAdapter($client, options: new MyboxAdapterOptions(
deletionMode: DeletionMode::Purge,
visibility: League\Flysystem\Visibility::PUBLIC,
));
$url = $filesystem->temporaryUrl('reports/2026-08.csv', new DateTimeImmutable('+5 minutes'));
use Illuminate\Support\Facades\Storage;
use League\Flysystem\Filesystem;
use Minhyung\Flysystem\Mybox\MyboxAdapter;
use Minhyung\Mybox\MyboxClient;
Storage::extend('mybox', function (array $app, array $config) {
$adapter = new MyboxAdapter(MyboxClient::create($config['token']), $config['root'] ?? '');
return new \Illuminate\Filesystem\FilesystemAdapter(new Filesystem($adapter), $adapter, $config);
});