PHPackages                             klytron/laravel-google-drive-filesystem - 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. klytron/laravel-google-drive-filesystem

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

klytron/laravel-google-drive-filesystem
=======================================

Google Drive filesystem adapter for Laravel (10, 11, 12)

v1.2.0(9mo ago)2526↓25%MITPHPPHP ^8.1

Since Jul 21Pushed 9mo agoCompare

[ Source](https://github.com/klytron/laravel-google-drive-filesystem)[ Packagist](https://packagist.org/packages/klytron/laravel-google-drive-filesystem)[ Docs](https://www.klytron.com/projects/laravel-google-drive-filesystem)[ Fund](https://www.klytron.com/buy-me-a-coffee)[ RSS](/packages/klytron-laravel-google-drive-filesystem/feed)WikiDiscussions main Synced 1mo ago

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

klytron/laravel-google-drive-filesystem
=======================================

[](#klytronlaravel-google-drive-filesystem)

[![Latest Version on Packagist](https://camo.githubusercontent.com/50ec3372b054355b49d7fb27db77174bd1f14e6e93ad61bd09c4e31e5622eacf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6c7974726f6e2f6c61726176656c2d676f6f676c652d64726976652d66696c6573797374656d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/klytron/laravel-google-drive-filesystem)[![Total Downloads](https://camo.githubusercontent.com/465ce9a16c0d993ff4e1f029887663fc55dc547c80ba5ac20a1c8e59b548dc95/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6c7974726f6e2f6c61726176656c2d676f6f676c652d64726976652d66696c6573797374656d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/klytron/laravel-google-drive-filesystem)[![License](https://camo.githubusercontent.com/d4dc6836941614fd9c8fbea633f340fbbc55207bff1f159e745cc4bc791fe9dd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b6c7974726f6e2f6c61726176656c2d676f6f676c652d64726976652d66696c6573797374656d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/klytron/laravel-google-drive-filesystem)[![PHP Version](https://camo.githubusercontent.com/2067efda7461af669aeb11463e0295d665f71e673650ef39bc2f8e50e34bd953/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b6c7974726f6e2f6c61726176656c2d676f6f676c652d64726976652d66696c6573797374656d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/klytron/laravel-google-drive-filesystem)[![Laravel Version](https://camo.githubusercontent.com/11ba5d99015522487fdaeafecd4de3c8f5e91bafd16811422ad0af48afd92dde/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e7825323025374325323031312e7825323025374325323031322e782d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](https://laravel.com/)

A robust Google Drive filesystem adapter for Laravel that provides seamless integration with Google Drive as a storage disk. Features configurable debug logging, automatic folder creation, and full Laravel Filesystem API compatibility.

✨ Features
----------

[](#-features)

- 🚀 **Full Laravel Filesystem API Support** - Use Google Drive like any other Laravel disk
- 🔧 **Configurable Debug Logging** - Control debug output in production environments
- 📁 **Automatic Folder Creation** - Folders are created automatically when needed
- 🔐 **Secure Authentication** - Support for both access tokens and refresh tokens
- 📊 **Metadata Support** - File sizes, modification times, and MIME types
- 🛡️ **Production Ready** - Proper error handling and logging configuration
- 📚 **Comprehensive Documentation** - Detailed setup and usage guides

📋 Requirements
--------------

[](#-requirements)

- PHP 8.1 or higher
- Laravel 10.x, 11.x, or 12.x
- Google Cloud Platform project with Drive API enabled

🚀 Quick Installation
--------------------

[](#-quick-installation)

Install via Composer:

```
composer require klytron/laravel-google-drive-filesystem
```

For advanced installation and VCS/development setup, see [docs/INSTALLATION.md](docs/INSTALLATION.md).

⚙️ Quick Configuration
----------------------

[](#️-quick-configuration)

Publish the config file and set up your `.env`:

```
php artisan vendor:publish --tag=google-drive-config
```

Add your Google Drive credentials to your `.env` file. For a detailed step-by-step guide, see [docs/GETTING-TOKENS.md](docs/GETTING-TOKENS.md).

### 🔑 Environment Variables

[](#-environment-variables)

```
# Google Drive API Credentials
GOOGLE_DRIVE_CLIENT_ID=your-client-id
GOOGLE_DRIVE_CLIENT_SECRET=your-client-secret
GOOGLE_DRIVE_ACCESS_TOKEN=your-access-token
GOOGLE_DRIVE_REFRESH_TOKEN=your-refresh-token
GOOGLE_DRIVE_FOLDER_ID=your-folder-id

# Debug Logging (optional)
GOOGLE_DRIVE_DEBUG=false
GOOGLE_DRIVE_LOG_PAYLOAD=false
```

#### Debug Logging Options

[](#debug-logging-options)

The debug logging options default to `APP_DEBUG` but can be overridden:

- **`GOOGLE_DRIVE_DEBUG`**: Enable detailed debug logging for operations (defaults to `APP_DEBUG`)
- **`GOOGLE_DRIVE_LOG_PAYLOAD`**: Enable logging of HTTP payloads and detailed operation info (defaults to `APP_DEBUG`)

> **Production Tip**: Set both debug options to `false` in production to prevent unnecessary log output.

📖 Usage
-------

[](#-usage)

After configuring, you can use the Google Drive disk in your Laravel application like this:

```
use Illuminate\Support\Facades\Storage;

// Store a file
Storage::disk('google')->put('example.txt', 'Hello, Google Drive!');

// Retrieve a file
$content = Storage::disk('google')->get('example.txt');

// List files in a directory
$files = Storage::disk('google')->files('/');

// Delete a file
Storage::disk('google')->delete('example.txt');

// Check if file exists
if (Storage::disk('google')->exists('example.txt')) {
    // File exists
}

// Get file size
$size = Storage::disk('google')->size('example.txt');

// Get last modified time
$modified = Storage::disk('google')->lastModified('example.txt');
```

### 🗂️ Working with Folders

[](#️-working-with-folders)

```
// Create a directory (folders are created automatically when uploading files)
Storage::disk('google')->makeDirectory('uploads/images');

// List directories
$directories = Storage::disk('google')->directories('/');

// List all contents (files and folders)
$contents = Storage::disk('google')->allFiles('/');

// Delete a directory and all its contents
Storage::disk('google')->deleteDirectory('uploads/images');
```

For advanced usage and more examples, see [docs/USAGE.md](docs/USAGE.md).

🔧 Laravel Compatibility
-----------------------

[](#-laravel-compatibility)

- **Laravel**: 10.x, 11.x, 12.x
- **PHP**: 8.1 or higher
- **Google API Client**: ^2.15
- **Flysystem**: ^3.0

📝 License
---------

[](#-license)

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

🔗 Links
-------

[](#-links)

- **Author**: [Michael K. Laweh](https://www.klytron.com)
- **GitHub**: [klytron](https://github.com/klytron)
- **Packagist**: [klytron/laravel-google-drive-filesystem](https://packagist.org/packages/klytron/laravel-google-drive-filesystem)
- **Issues**: [GitHub Issues](https://github.com/klytron/laravel-google-drive-filesystem/issues)
- **Funding**: [Buy me a coffee](https://www.klytron.com/buy-me-a-coffee)

📚 Documentation
---------------

[](#-documentation)

- [Installation Guide](docs/INSTALLATION.md)
- [Getting Google Drive Tokens](docs/GETTING-TOKENS.md)
- [Advanced Usage](docs/USAGE.md)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance58

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~4 days

Total

8

Last Release

274d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c696458a29585d45beb5ed8f0cb22e23a2698dad1f9f0515d66de5934d2ae79?d=identicon)[klytron](/maintainers/klytron)

---

Top Contributors

[![klytron](https://avatars.githubusercontent.com/u/11487236?v=4)](https://github.com/klytron "klytron (2 commits)")

---

Tags

filesystemlaravelstoragegoogle-drive

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/klytron-laravel-google-drive-filesystem/health.svg)

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

###  Alternatives

[unisharp/laravel-filemanager

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

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[zing/laravel-flysystem-obs

Flysystem Adapter for OBS

1211.2k](/packages/zing-laravel-flysystem-obs)[yoelpc4/laravel-cloudinary

Laravel Cloudinary filesystem cloud driver.

3343.0k](/packages/yoelpc4-laravel-cloudinary)[innoge/laravel-rclone

A sleek PHP wrapper around rclone with Laravel-style fluent API syntax

174.1k](/packages/innoge-laravel-rclone)

PHPackages © 2026

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