PHPackages                             justus/flysystem-onedrive - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. justus/flysystem-onedrive

ActiveLibrary[File &amp; Storage](/categories/file-storage)

justus/flysystem-onedrive
=========================

A flysystem driver for OneDrive that uses the Microsoft Graph API

v2.0.7(1y ago)49142.4k↑20.1%26[3 issues](https://github.com/doerffler/flysystem-onedrive/issues)[3 PRs](https://github.com/doerffler/flysystem-onedrive/pulls)MITPHPPHP ^8.1

Since Sep 20Pushed 1y ago3 watchersCompare

[ Source](https://github.com/doerffler/flysystem-onedrive)[ Packagist](https://packagist.org/packages/justus/flysystem-onedrive)[ RSS](/packages/justus-flysystem-onedrive/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (9)Dependencies (6)Versions (10)Used By (0)

[![![Banner]](https://camo.githubusercontent.com/5541d462f49f1f5bea4f093746b196e8274f561953a8e8bb79161004b1ad7853/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f466c7973797374656d2532304f6e6544726976652e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6a7573747573253246666c7973797374656d2d6f6e656472697665267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d412b666c7973797374656d2b6472697665722b666f722b4f6e6544726976652b746861742b757365732b7468652b4d6963726f736f66742b47726170682b415049266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d636c6f7564)](https://camo.githubusercontent.com/5541d462f49f1f5bea4f093746b196e8274f561953a8e8bb79161004b1ad7853/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f466c7973797374656d2532304f6e6544726976652e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6a7573747573253246666c7973797374656d2d6f6e656472697665267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d412b666c7973797374656d2b6472697665722b666f722b4f6e6544726976652b746861742b757365732b7468652b4d6963726f736f66742b47726170682b415049266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d636c6f7564)

Flysystem adapter for Microsoft OneDrive
========================================

[](#flysystem-adapter-for-microsoft-onedrive)

This package contains a Flysystem OneDrive adapter, which makes use of the Microsoft Graph API. The adapter is ready for the latest Laravel 12.x version.

You can use this package to access files stored in onedrive or sharepoint folders from your PHP or Laravel web applications.

[![CI](https://github.com/doerffler/flysystem-onedrive/actions/workflows/code_checks.yaml/badge.svg?branch=main)](https://github.com/doerffler/flysystem-onedrive/actions/workflows/code_checks.yaml)[![Latest Stable Version](https://camo.githubusercontent.com/28549e65862a9fb2d5d9366227df461993729d2e87c3880e7d6a3bf63c7fea9e/687474703a2f2f706f7365722e707567782e6f72672f6a75737475732f666c7973797374656d2d6f6e6564726976652f76)](https://packagist.org/packages/justus/flysystem-onedrive)[![Total Downloads](https://camo.githubusercontent.com/48caffea7cb5d66c135b0d5d18543e4faa3fa38a399150cf4a012011a3f03d90/687474703a2f2f706f7365722e707567782e6f72672f6a75737475732f666c7973797374656d2d6f6e6564726976652f646f776e6c6f616473)](https://packagist.org/packages/justus/flysystem-onedrive)[![Latest Unstable Version](https://camo.githubusercontent.com/c8b89e3ae5d2526aaefae8c3fae6612fbbc29bf5146219aa200a9839b08cb312/687474703a2f2f706f7365722e707567782e6f72672f6a75737475732f666c7973797374656d2d6f6e6564726976652f762f756e737461626c65)](https://packagist.org/packages/justus/flysystem-onedrive)[![License](https://camo.githubusercontent.com/86548bc211a3582688dbd646a0de569decc29c5b127da41c4baa744f6d71f97f/687474703a2f2f706f7365722e707567782e6f72672f6a75737475732f666c7973797374656d2d6f6e6564726976652f6c6963656e7365)](https://packagist.org/packages/justus/flysystem-onedrive)[![PHP Version Require](https://camo.githubusercontent.com/0a9b6cb5c58506d05dbe89b54d0d33ced8a1b6de8d8e9dcc06908445c257e79b/687474703a2f2f706f7365722e707567782e6f72672f6a75737475732f666c7973797374656d2d6f6e6564726976652f726571756972652f706870)](https://packagist.org/packages/justus/flysystem-onedrive)

1. Installation
---------------

[](#1-installation)

Simply install the package using composer:

```
composer require justus/flysystem-onedrive
```

2. Usage
--------

[](#2-usage)

### Laravel Usage

[](#laravel-usage)

1. Add the following variables to your `.env` file

example for 'personal' OneDrive

```
ONEDRIVE_ROOT=me
ONEDRIVE_ACCESS_TOKEN=fd6s7a98...
ONEDRIVE_DIR_TYPE=drives
```

example for 'group shared' OneDrive

```
ONEDRIVE_ROOT="{group_id}/drive"
ONEDRIVE_ACCESS_TOKEN=fd6s7a98...
ONEDRIVE_DIR_TYPE=groups
```

2. In the file `config/filesystems.php`, please add the following code snippet to the disks section

```
'onedrive' => [
    'driver' => 'onedrive',
    'root' => env('ONEDRIVE_ROOT'),
    'access_token' => env('ONEDRIVE_ACCESS_TOKEN'), //optional if demanded
    'directory_type' => env('ONEDRIVE_DIR_TYPE')
],
```

3. Add the `OneDriveAdapterServiceProvider` in `config/app.php`

```
'providers' => [
    // ...
    Justus\FlysystemOneDrive\Providers\OneDriveAdapterServiceProvider::class,
    // ...
],
```

There are two established approaches of using the package

- On demand: Recommended if you use a dynamic graph access token. (usage e. g. session('graph\_access\_token'))

```
$disk = Storage::build([
    'driver' => config('filesystems.disks.onedrive.driver'),
    'root' => config('filesystems.disks.onedrive.root'),
    'directory_type' => config('filesystems.disks.onedrive.directory_type'),
    'access_token' => session('graph_access_token')
]);

$disk->makeDirectory('test');
```

- Default with Storage Facade: Recommended if you use a static graph access token.

```
Storage::disk('onedrive')->makeDirectory('test');
```

### PHP Usage

[](#php-usage)

Usage in php without Laravel framework

```
$options = [

];

$graph = new Graph();
$graph->setAccessToken('fd6s7a98...');

$adapter = new OneDriveAdapter($graph, 'root/path', $options);

$filesystem = new Filesystem($adapter);

$filesystem->createDirectory('test');
```

3. Changelog
------------

[](#3-changelog)

Please see CHANGELOG for more information on recent changes.

4. Testing
----------

[](#4-testing)

```
composer test
```

5. Security
-----------

[](#5-security)

If you discover any security related issues, please write an email to  instead of using the issue tracker.

6. License
----------

[](#6-license)

The MIT License (MIT). Please see License File for more information.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance42

Moderate activity, may be stable

Popularity48

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 67.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~116 days

Recently: every ~179 days

Total

9

Last Release

448d ago

PHP version history (2 changes)v1PHP ^8.0.2

v2.0.7PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c8ea20fc34a6b514fb2e77b9a5f16fc38c168423ec4bd4af9da7a70375cc3be3?d=identicon)[Jusdon](/maintainers/Jusdon)

---

Top Contributors

[![Jusdon](https://avatars.githubusercontent.com/u/34418811?v=4)](https://github.com/Jusdon "Jusdon (46 commits)")[![timo2o1o](https://avatars.githubusercontent.com/u/8312711?v=4)](https://github.com/timo2o1o "timo2o1o (8 commits)")[![Chris8934](https://avatars.githubusercontent.com/u/44963939?v=4)](https://github.com/Chris8934 "Chris8934 (7 commits)")[![kfriars](https://avatars.githubusercontent.com/u/3378675?v=4)](https://github.com/kfriars "kfriars (2 commits)")[![jfoucher](https://avatars.githubusercontent.com/u/152015?v=4)](https://github.com/jfoucher "jfoucher (1 commits)")[![Jamesking56](https://avatars.githubusercontent.com/u/253237?v=4)](https://github.com/Jamesking56 "Jamesking56 (1 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![mgjgid](https://avatars.githubusercontent.com/u/36155814?v=4)](https://github.com/mgjgid "mgjgid (1 commits)")[![Chris53897](https://avatars.githubusercontent.com/u/7104259?v=4)](https://github.com/Chris53897 "Chris53897 (1 commits)")

---

Tags

apiflysystemflysystem-adaptergraphapilaravelonedrivephpapiFlysystemOneDriveflysystem-onedrive

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/justus-flysystem-onedrive/health.svg)

```
[![Health](https://phpackages.com/badges/justus-flysystem-onedrive/health.svg)](https://phpackages.com/packages/justus-flysystem-onedrive)
```

###  Alternatives

[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.5M85](/packages/unisharp-laravel-filemanager)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k285.7M1.0k](/packages/league-flysystem-aws-s3-v3)[shitware-ltd/flysystem-msgraph

A Flysystem 3.0 adapter for Sharepoint 365 / OneDrive using Microsoft Graph API with support for uploading large files

19466.1k4](/packages/shitware-ltd-flysystem-msgraph)[jacekbarecki/flysystem-onedrive

OneDrive adapter for the flysystem filesystem abstraction library

2431.0k](/packages/jacekbarecki-flysystem-onedrive)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
