PHPackages                             logisticinfotech/flysystem-google-drive - 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. logisticinfotech/flysystem-google-drive

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

logisticinfotech/flysystem-google-drive
=======================================

Flysystem adapter for Google Drive

1.1.11(7y ago)04.8k1MITPHPPHP &gt;=5.4.0

Since Feb 17Pushed 6y agoCompare

[ Source](https://github.com/logisticinfotech/flysystem-google-drive)[ Packagist](https://packagist.org/packages/logisticinfotech/flysystem-google-drive)[ RSS](/packages/logisticinfotech-flysystem-google-drive/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (18)Used By (0)

Flysystem Adapter for Google Drive
==================================

[](#flysystem-adapter-for-google-drive)

[![Author](https://camo.githubusercontent.com/204e32c8ec40a28cd778a206d8f90cb3bf783a9c40c1872bf5f97ff06df7b90e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d6e616f2d2d706f6e2532306879707765622d626c75652e7376673f7374796c653d666c6174)](http://xoops.hypweb.net/)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Installation
------------

[](#installation)

- For Google Drive API V3

```
composer require nao-pon/flysystem-google-drive:~1.1
```

- For Google Drive API V2 "**Deprecated**"

```
composer require nao-pon/flysystem-google-drive:~1.0.0
```

Usage
-----

[](#usage)

#### Follow [Google Docs](https://developers.google.com/drive/v3/web/enable-sdk) to obtain your `ClientId, ClientSecret & refreshToken` in addition you can also check this [easy-to-follow tutorial](https://gist.github.com/ivanvermeyen/cc7c59c185daad9d4e7cb8c661d7b89b)

[](#follow-google-docs-to-obtain-your-clientid-clientsecret--refreshtoken-in-addition-you-can-also-check-this-easy-to-follow-tutorial)

- you can also check [This Example](https://github.com/nao-pon/flysystem-google-drive/blob/master/example/GoogleUpload.php) for a better understanding.

```
$client = new \Google_Client();
$client->setClientId('[app client id].apps.googleusercontent.com');
$client->setClientSecret('[app client secret]');
$client->refreshToken('[your refresh token]');

$service = new \Google_Service_Drive($client);

$adapter = new \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter($service, '['root' or folder ID]');
/* Recommended cached adapter use */
// $adapter = new \League\Flysystem\Cached\CachedAdapter(
//     new \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter($service, '['root' or folder ID]'),
//     new \League\Flysystem\Cached\Storage\Memory()
// );

$filesystem = new \League\Flysystem\Filesystem($adapter);
```

### Usage to with [elFinder](https://github.com/Studio-42/elFinder)

[](#usage-to-with-elfinder)

```
composer require nao-pon/elfinder-flysystem-driver-ext
composer require nao-pon/flysystem-google-drive:~1.1
```

```
// Load composer autoloader
require 'vender/autoload.php';

// Google API Client
$client = new \Google_Client();
$client->setClientId('xxxxx CLIENTID xxxxx');
$client->setClientSecret('xxxxx CLIENTSECRET xxxxx');
$client->refreshToken('xxxxx REFRESH TOKEN xxxxx');

// Google Drive Adapter
$googleDrive = new \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter(
	new \Google_Service_Drive($client), // Client service
	'root',                             // Folder ID as root ('root' or Folder ID)
	[ 'useHasDir' => true ]             // options (elFinder need hasDir method)
);

// Extended cached strage adapter class for cache enabled of hasDir() method
class myCachedStrageAdapter extends \League\Flysystem\Cached\Storage\Adapter
{
    use \Hypweb\Flysystem\Cached\Extra\Hasdir;
    use \Hypweb\Flysystem\Cached\Extra\DisableEnsureParentDirectories;
}

// Make Flysystem adapter and cache object
$useCache = true;
if ($useCache) {
	// Example to Flysystem cacheing
	$cache = new myCachedStrageAdapter(
		new \League\Flysystem\Adapter\Local('flycache'),
		'gdcache',
		300
	);

	// Flysystem cached adapter
	$adapter = new \League\Flysystem\Cached\CachedAdapter(
		$googleDrive,
		$cache
	);
} else {
	// Not use cached adapter
	$cache = null;
	$adapter = $googleDrive;
}

// Google Drive elFinder Volume driver
$gdrive = [
    // require
    'driver'       => 'FlysystemExt',
    'filesystem'   =>  new \League\Flysystem\Filesystem($adapter),
    'fscache'      => $cache,
    'separator'    => '/',
    // optional
    'alias'        => 'GoogleDrive',
    'rootCssClass' => 'elfinder-navbar-root-googledrive'
];

// elFinder volume roots options
$elFinderOpts = [
	'roots' => []
];

$elFinderOpts['roots'][] = $gdrive;

// run elFinder
$connector = new elFinderConnector(new elFinder($elFinderOpts));
$connector->run();
```

Tips
----

[](#tips)

- [Setup a Laravel Storage driver with Google Drive API](https://gist.github.com/ivanvermeyen/cc7c59c185daad9d4e7cb8c661d7b89b)
- [Issue list with "HowTo" tag](https://github.com/nao-pon/flysystem-google-drive/issues?utf8=%E2%9C%93&q=label%3AHowTo%20)

TODO
----

[](#todo)

- Unit tests to be written

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 87.3% 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 ~78 days

Recently: every ~108 days

Total

16

Last Release

2563d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25176031?v=4)[Nirav Adatiya](/maintainers/niravjadatiya)[@niravjadatiya](https://github.com/niravjadatiya)

---

Top Contributors

[![nao-pon](https://avatars.githubusercontent.com/u/1412630?v=4)](https://github.com/nao-pon "nao-pon (89 commits)")[![benlumley](https://avatars.githubusercontent.com/u/194052?v=4)](https://github.com/benlumley "benlumley (1 commits)")[![Bilge](https://avatars.githubusercontent.com/u/470626?v=4)](https://github.com/Bilge "Bilge (1 commits)")[![chintan13](https://avatars.githubusercontent.com/u/243013?v=4)](https://github.com/chintan13 "chintan13 (1 commits)")[![DynamoGeek](https://avatars.githubusercontent.com/u/3771182?v=4)](https://github.com/DynamoGeek "DynamoGeek (1 commits)")[![marvin-heinrich](https://avatars.githubusercontent.com/u/33798628?v=4)](https://github.com/marvin-heinrich "marvin-heinrich (1 commits)")[![mrblur](https://avatars.githubusercontent.com/u/842077?v=4)](https://github.com/mrblur "mrblur (1 commits)")[![nileshkikani](https://avatars.githubusercontent.com/u/708418?v=4)](https://github.com/nileshkikani "nileshkikani (1 commits)")[![OskarStark](https://avatars.githubusercontent.com/u/995707?v=4)](https://github.com/OskarStark "OskarStark (1 commits)")[![tobias-kuendig](https://avatars.githubusercontent.com/u/8600029?v=4)](https://github.com/tobias-kuendig "tobias-kuendig (1 commits)")[![tomatow](https://avatars.githubusercontent.com/u/16914394?v=4)](https://github.com/tomatow "tomatow (1 commits)")[![Unemployed](https://avatars.githubusercontent.com/u/7939211?v=4)](https://github.com/Unemployed "Unemployed (1 commits)")[![A34](https://avatars.githubusercontent.com/u/1741817?v=4)](https://github.com/A34 "A34 (1 commits)")[![vishal112logistic](https://avatars.githubusercontent.com/u/50409078?v=4)](https://github.com/vishal112logistic "vishal112logistic (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/logisticinfotech-flysystem-google-drive/health.svg)

```
[![Health](https://phpackages.com/badges/logisticinfotech-flysystem-google-drive/health.svg)](https://phpackages.com/packages/logisticinfotech-flysystem-google-drive)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M784](/packages/league-flysystem-aws-s3-v3)[unisharp/laravel-filemanager

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

2.2k3.3M73](/packages/unisharp-laravel-filemanager)[nao-pon/flysystem-google-drive

Flysystem adapter for Google Drive

3672.0M20](/packages/nao-pon-flysystem-google-drive)[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)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6129.6M91](/packages/league-flysystem-sftp-v3)[yii2-starter-kit/yii2-file-kit

Yii2 file upload and storage kit

151216.8k6](/packages/yii2-starter-kit-yii2-file-kit)

PHPackages © 2026

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