PHPackages                             bitsnbolts/flysystem-msgraph - 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. bitsnbolts/flysystem-msgraph

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

bitsnbolts/flysystem-msgraph
============================

A Flysystem Adapter that supports Microsoft OneDrive and Sharepoint Document Libraries using Microsoft Graph

1.0.3(5y ago)02.5k2MITPHP

Since Feb 19Pushed 5y agoCompare

[ Source](https://github.com/bitsnbolts/flysystem-msgraph)[ Packagist](https://packagist.org/packages/bitsnbolts/flysystem-msgraph)[ RSS](/packages/bitsnbolts-flysystem-msgraph/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

flysystem-msgraph
=================

[](#flysystem-msgraph)

A Flysystem Adapter that supports Microsoft OneDrive and Sharepoint Document Libraries using Microsoft Graph

Setting Up A Background App For Microsoft Graph
-----------------------------------------------

[](#setting-up-a-background-app-for-microsoft-graph)

This flysystem adapter operates as a Background Service. See  for more detailed information on how to configure an application.

When setting up permissions, you must add Application Permissions to specify File.ReadWrite.All.

Once your app is completed, you'll need your Administrator to consent to the application using the Azure Portal at .

Using with OneDrive
-------------------

[](#using-with-onedrive)

- Currently OneDrive is not supported. Development is continuing to support OneDrive.

Using with Sharepoint Document Libraries
----------------------------------------

[](#using-with-sharepoint-document-libraries)

Adapter Constructor Definition:

```
$adapter = new MSGraphAppSharepoint();

// Generate a token.
$adapter->authorize($tenantId, $appId, $appPassword);

// Setup the site and drive ids.
$adapter->initialize($targetId, $driveName);

$this->fs = new Filesystem($adapter);

$this->fs->write('hello.txt', 'Hello World!');
```

- $appId : The Application ID which can be found in the Application Registration
- $appPassword : The generated password created in the Application Registration
- $tenantId : The GUID of the tenant.
- $tokenEndpoint : The OAuth2 Access Token Endpoint for your Azure/Office365 Tenant. (Ex: )
- $mode : Either 'sharepoint' or 'onedrive' which will specify the target mode. (Note, only Sharepoint is supported currently)
- $targetId : The target ID for specifying where the files should reside.
    - For Sharepoint, the sharepoint url (Ex: example.sharepoint.com) can be used as well as a URL to the site (Ex: example.sharepoint.com:/sites/EXAMPLE)
- $driveName : The name of the document library or drive for the specified sharepoint site.

Running Tests
-------------

[](#running-tests)

The tests are functional in which a valid Microsoft Office 365/Azure environment must be available. Once you have your application id and password and the application has consent from the administrator, you must provide the credentials through environment variables and then run the phpunit test suites. The environment variables requires are:

- APP\_ID : The application ID you registered
- APP\_PASSWORD : The application Password you generated
- TENANT\_ID : The GUID of the tenant.
- TEST\_SHAREPOINT\_SITE\_ID : The Sharepoint Site ID to utilize. This should ideally be the FQDN of the sharepoint site (Ex: example.sharepoint.com)
- OAUTH\_AUTHORITY (optional) : The OAuth2 Authority URL to use. Defaults to
- OAUTH\_AUTHORIZE\_ENDPOINT (optional) : The OAuth2 Authorize Endpoint to use. Defaults to /oauth2/authorize?api-version=1.0
- OAUTH\_TOKEN\_ENDPOINT (optional) : The OAuth2 Token Endpoint to use. Defaults to /oauth2/token?api-version=1.0
- TEST\_FILE\_PREFIX (optional) : The prefix to add to all file paths for this test suite. Default to no prefix

### Testing large file uploads.

[](#testing-large-file-uploads)

To test the large file upload, generate a large file here  and save it to `tests/files.50MB.bin`.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.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 ~15 days

Total

4

Last Release

1868d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4395242ced08362b402e6117b60fe23df915df83e48b9b6bb8940b31ea55a660?d=identicon)[thijsvdanker](/maintainers/thijsvdanker)

---

Top Contributors

[![thijsvdanker](https://avatars.githubusercontent.com/u/429548?v=4)](https://github.com/thijsvdanker "thijsvdanker (25 commits)")[![tdondich](https://avatars.githubusercontent.com/u/3330334?v=4)](https://github.com/tdondich "tdondich (13 commits)")[![gms8994](https://avatars.githubusercontent.com/u/50712?v=4)](https://github.com/gms8994 "gms8994 (6 commits)")[![adiwit-co-th](https://avatars.githubusercontent.com/u/50860673?v=4)](https://github.com/adiwit-co-th "adiwit-co-th (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bitsnbolts-flysystem-msgraph/health.svg)

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

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[google/cloud

Google Cloud Client Library

1.2k16.2M53](/packages/google-cloud)[stechstudio/laravel-zipstream

A fast and simple streaming zip file downloader for Laravel.

4633.7M3](/packages/stechstudio-laravel-zipstream)[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)[masbug/flysystem-google-drive-ext

Flysystem adapter for Google Drive with seamless virtual&lt;=&gt;display path translation

2631.7M14](/packages/masbug-flysystem-google-drive-ext)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)

PHPackages © 2026

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