PHPackages                             basecardhero/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. [API Development](/categories/api)
4. /
5. basecardhero/drive

ActiveLibrary[API Development](/categories/api)

basecardhero/drive
==================

A Google services wrapper library for creating Google Drive.

v0.1.1(7y ago)150MITPHPPHP ^7.1CI failing

Since Mar 16Pushed 6y agoCompare

[ Source](https://github.com/basecardhero/drive)[ Packagist](https://packagist.org/packages/basecardhero/drive)[ Docs](https://github.com/basecardhero/drive)[ RSS](/packages/basecardhero-drive/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

BaseCardHero - Drive
====================

[](#basecardhero---drive)

[![Build Status](https://camo.githubusercontent.com/201a38b0106ca08a918a45c9a77245ccb09c842852b674b910236850e3e1fb68/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f62617365636172646865726f2f64726976652f6d61737465722e737667)](https://travis-ci.org/basecardhero/drive)[![codecov](https://camo.githubusercontent.com/04f73f700f3a3e15ae77d4c6d55f0021cc1b4150cb65ce57dc989f61abccd7ca/68747470733a2f2f636f6465636f762e696f2f67682f62617365636172646865726f2f64726976652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/basecardhero/drive)[![License](https://camo.githubusercontent.com/aaa277261b7116968d12ac8010ae782538541925c0adcd41bcd3262b85c1f55e/68747470733a2f2f706f7365722e707567782e6f72672f62617365636172646865726f2f64726976652f6c6963656e7365)](https://packagist.org/packages/basecardhero/drive)[![composer.lock](https://camo.githubusercontent.com/b3539bb0cfd220b8de558e1e6f3e9c336786c028d925d9f18c297f82abd771d5/68747470733a2f2f706f7365722e707567782e6f72672f62617365636172646865726f2f64726976652f636f6d706f7365726c6f636b)](https://packagist.org/packages/basecardhero/drive)

*This package was created for a project I am working on and does not fully support Google services (or the way you may want it to). Feel free to add functionality by creating a pull request. See [contributing](CONTRIBUTING.md).*

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

[](#installation)

You can install the package via [composer](https://getcomposer.org/):

```
$ composer require basecardhero/drive
```

Usage
-----

[](#usage)

You will need to configure the [Google Client](https://github.com/googleapis/google-api-php-client). See [gsuitedevs/php-samples](https://github.com/gsuitedevs/php-samples) for examples configuring a Google Client for php.

### Examples

[](#examples)

#### Create a Drive instance

[](#create-a-drive-instance)

```
require_once '/project/path/vendor/autoload.php';

$client = new \Google_Client(); // Make sure to configure your Google client.
$driveService = new \Google_Service_Drive($client);
$drive = new \BaseCardHero\Drive\Drive($driveService);
```

#### Get the Google\_Service\_Drive instance

[](#get-the-google_service_drive-instance)

```
$drive->getService() // \Google_Service_Drive
```

#### Retrieve a file

[](#retrieve-a-file)

```
$file = $drive->get('efTpcKY4TL2DWbExuvBuRxlmVFtsxpAeyHmMfxpwcobePxKV');

echo get_class($file); // \Google_Service_Drive_DriveFile
echo $file->id; // 'efTpcKY4TL2DWbExuvBuRxlmVFtsxpAeyHmMfxpwcobePxKV'
```

#### Set file permissions

[](#set-file-permissions)

```
$fileId = 'efTpcKY4TL2DWbExuvBuRxlmVFtsxpAeyHmMfxpwcobePxKV';
$permissions = $drive->setPermission($fileId, 'anyone', 'reader');

echo get_class($permissions); // \Google_Service_Drive_Permission
```

#### Create a file

[](#create-a-file)

See [mime types](https://developers.google.com/drive/api/v3/mime-types).

```
$file = $drive->create('My File', 'application/vnd.google-apps.file');

echo get_class($file); // \Google_Service_Drive_DriveFile
echo $file->id; // 'efTpcKY4TL2DWbExuvBuRxlmVFtsxpAeyHmMfxpwcobePxKV'
```

#### Create a folder

[](#create-a-folder)

```
$folder = $drive->createFolder('My Folder');

echo get_class($folder); // \Google_Service_Drive_DriveFile
echo $folder->id; // 'efTpcKY4TL2DWbExuvBuRxlmVFtsxpAeyHmMfxpwcobePxKV'
```

#### Delete a file

[](#delete-a-file)

```
$fileId = 'efTpcKY4TL2DWbExuvBuRxlmVFtsxpAeyHmMfxpwcobePxKV';

$drive->delete($fileId); // null
```

### Testing

[](#testing)

```
$ composer all
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

### Contributing

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

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

### Credits

[](#credits)

- [Base Card Hero](https://github.com/basecardhero) | [basecardhero.com](https://basecardhero.com/)
- [All Contributors](../../contributors)

### License

[](#license)

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

### PHP Package Boilerplate

[](#php-package-boilerplate)

This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.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 ~37 days

Total

2

Last Release

2579d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29577813?v=4)[Base Card Hero](/maintainers/basecardhero)[@basecardhero](https://github.com/basecardhero)

---

Top Contributors

[![basecardhero](https://avatars.githubusercontent.com/u/29577813?v=4)](https://github.com/basecardhero "basecardhero (7 commits)")[![rfmeier](https://avatars.githubusercontent.com/u/1128283?v=4)](https://github.com/rfmeier "rfmeier (4 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/basecardhero-drive/health.svg)

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

###  Alternatives

[revolution/laravel-google-sheets

Google Sheets API v4

4483.1M6](/packages/revolution-laravel-google-sheets)[pulkitjalan/google-apiclient

Google api php client wrapper with Cloud Platform and Laravel support

2582.9M5](/packages/pulkitjalan-google-apiclient)[dacastro4/laravel-gmail

Gmail API package for Laravel

312382.9k1](/packages/dacastro4-laravel-gmail)[spotonlive/php-google-my-business

Google MyBusiness

31677.1k](/packages/spotonlive-php-google-my-business)[happyr/google-api-bundle

A Symfony2 Wrapper for the Google APIs Client Library for PHP

48196.1k](/packages/happyr-google-api-bundle)[mediafigaro/google-analytics-api-symfony

Google Analytics API v4 Symfony

46177.7k](/packages/mediafigaro-google-analytics-api-symfony)

PHPackages © 2026

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