1. Go to this page and download the library: Download leapt/flysystem-onedrive 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/ */
leapt / flysystem-onedrive example snippets
use League\Flysystem\Filesystem;
use Leapt\FlysystemOneDrive\OneDriveAdapter;
use Microsoft\Graph\Graph;
$graph = new Graph();
$graph->setAccessToken('EwBIA8l6BAAU7p9QDpi...');
$adapter = new OneDriveAdapter($graph);
$filesystem = new Filesystem($adapter);
// Or to use the approot endpoint:
$adapter = new OneDriveAdapter($graph, 'special/approot');