PHPackages                             zlt/php-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zlt/php-google-drive

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zlt/php-google-drive
====================

Easy-To-Use PHP Library For Google Drive

v0.2.2(1y ago)2307MITPHP

Since Sep 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/w99910/php-google-drive)[ Packagist](https://packagist.org/packages/zlt/php-google-drive)[ Fund](https://www.buymeacoffee.com/zawlintun)[ RSS](/packages/zlt-php-google-drive/feed)WikiDiscussions master Synced 1mo ago

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

Easy-To-Use PHP Library For Google Drive
========================================

[](#easy-to-use-php-library-for-google-drive)

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

    [](#installation)

    ```
    $ composer require zlt/php-google-drive
    ```
- Setup
    -----

    [](#setup)

    ```
    $clientId = 'clientId';
    $clientSecret = 'clientSecret';
    $refreshToken = 'refreshToken';
    $config = new GoogleDriveConfig(clientId: $clientId, clientSecret: $clientSecret, refreshToken: $refreshToken);
    $service = new GoogleDriveService($config);
    ```

> If you don't know how to find the credentials i.e, clientId, clientSecret, refreshToken, read [here](https://github.com/ivanvermeyen/laravel-google-drive-demo/blob/master/README.md#create-your-google-drive-api-keys).

- Usage
    -----

    [](#usage)
- ### Creating Content

    [](#creating-content)

    Use `put` method which accepts three parameters:

    - `content` - contents to be stored
    - `fileName` - filename of content to be stored
    - `dir` - If not specified, file will be stored under root. Otherwise, file will be stored under specifed dir.

    ```
    $service->put('This is example text', 'example.txt');

    $service->put('This is text will be stored under specified dir','example.txt','12sdf_sdfjopwoeriupsdf')
    ```
- ### Getting File

    [](#getting-file)

    Use `get` method which accepts two parameters and return `Google\Drive\DriveFile` or `GuzzleHttp\Psr7\Response`

    - `fileName` - filename of content to be stored
    - `params` - If not specified, empty array is passed.

    ```
    $service->get('xxxxxxxxxxxxx');

    // or

    $service->get('xxxxxxxxxxxxx', [
      // pass parameters
    ])
    ```
- ### Getting File Content

    [](#getting-file-content)

    Use `getContent` method which return `GuzzleHttp\Psr7\Response`.

    - `fileName` - filename of content to be stored

    ```
    $service->getContent('xxxxxxxxxxxxx');
    ```
- ### Creating Dir

    [](#creating-dir)

    Use `makeDirectory` which accepts two parameters:

    - `folderName` - folderName
    - `dir` - If not specified, folder will be created under root. Otherwise, folder will be created under specifed dir.

    ```
    $service->makeDirectory('New Folder');

    $service->makeDirectory('New Folder Under Specified Dir','12sdf_sdfjopwoeriupsdf')
    ```
- ### Copy File

    [](#copy-file)

    Use `copy` which accepts three parameters:

    - `fromId` - fileId
    - `fileName` - fileName
    - `dir` - If not specified, folder will be created under root. Otherwise, folder will be created under specifed dir.

    ```
    $service->copy('1kojo32uoiuo123','new file.txt');

    $service->copy('1kojo32uoiuo123','new file.txt','12sdf_sdfjopwoeriupsdf')
    ```
- ### List Contents

    [](#list-contents)

    Use `listContents` method which accepts two parameters: `path` which is either pathId, fileName, folderName ,and `recursive` which decide to show children contents.

    ```
      // List files inside root dir.
      $service->listContents()

      // List files inside 'shared with me' folder.
      $service->listContents(Zlt\PhpGoogleDrive\GoogleDriveService::SharedWithMe);
    ```
- ### List Directories

    [](#list-directories)

    Use `directories` method which accepts two parameters: `path` which is either pathId, fileName, folderName

    ```
      // List files inside root dir.
      $service->directories()

      // List files inside 'shared with me' folder.
      $service->directories(Zlt\PhpGoogleDrive\GoogleDriveService::SharedWithMe);
    ```
- ### List Files

    [](#list-files)

    Use `files` method which accepts two parameters: `path` which is either pathId, fileName, folderName

    ```
      // List files inside root dir.
      $service->files()

      // List files inside 'shared with me' folder.
      $service->files(Zlt\PhpGoogleDrive\GoogleDriveService::SharedWithMe);
    ```
- ### Delete File or Folder

    [](#delete-file-or-folder)

    Delete file

    ```
    $service->delete('fileId')
    ```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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 ~231 days

Total

4

Last Release

644d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8cc3500e43c9d8366ea5b2b974176026c785ee56a3f93445a5262f155e9d37c9?d=identicon)[zawlintun](/maintainers/zawlintun)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/zlt-php-google-drive/health.svg)

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

###  Alternatives

[spatie/laravel-google-calendar

Manage events on a Google Calendar

1.4k1.5M21](/packages/spatie-laravel-google-calendar)[tomatophp/filament-seo

Manage and generate SEO tags and integrate your website with Google SEO services

112.6k1](/packages/tomatophp-filament-seo)[infoweb-internet-solutions/yii2-cms-analytics

Analytics module for Yii2

112.4k1](/packages/infoweb-internet-solutions-yii2-cms-analytics)

PHPackages © 2026

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