PHPackages                             macromindonline/google-apiclient - 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. macromindonline/google-apiclient

ActiveLibrary[API Development](/categories/api)

macromindonline/google-apiclient
================================

Google api php client wrapper with Cloud Platform and Laravel 4 &amp; 5 support

3.1.4(8y ago)017MITPHPPHP &gt;=5.4.0

Since Jan 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/macromindonline/google-apiclient)[ Packagist](https://packagist.org/packages/macromindonline/google-apiclient)[ Docs](https://github.com/pulkitjalan/google-apiclient)[ RSS](/packages/macromindonline-google-apiclient/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (15)Used By (0)

Google Api Client Wrapper
=========================

[](#google-api-client-wrapper)

> Google api php client wrapper with Cloud Platform and Laravel 4 &amp; 5 support

[![Build Status](https://camo.githubusercontent.com/202654f74525e38c3e8a837046977120231b557372c06ec6f21feb9c6e2ee79c/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f70756c6b69746a616c616e2f676f6f676c652d617069636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/pulkitjalan/google-apiclient)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a0b00b00a97594e7870d9f825ef10ac8af3ec182b5d550aef76fc87e808d516a/687474703a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f70756c6b69746a616c616e2f676f6f676c652d617069636c69656e742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/pulkitjalan/google-apiclient/)[![Coverage Status](https://camo.githubusercontent.com/50975ef872e0c356423f718bc1559eb479967dd51d5a2f97ea499c03aea01c37/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f70756c6b69746a616c616e2f676f6f676c652d617069636c69656e742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/pulkitjalan/google-apiclient/code-structure/master)[![License](https://camo.githubusercontent.com/30597ff9a350144f03bffdd9183e16468e0b3ca1193e1d08591d992622738d55/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://www.opensource.org/licenses/MIT)[![Latest Version](https://camo.githubusercontent.com/16d53b24dd926dd3ca2127deed7908c03db71e1ab449c17a063a5df05fcd9cb9/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70756c6b69746a616c616e2f676f6f676c652d617069636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pulkitjalan/google-apiclient)[![Total Downloads](https://camo.githubusercontent.com/6d5fc52e30b2445d0029507390e48b38ba776c8565f53ec09c2d470945887ab7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70756c6b69746a616c616e2f676f6f676c652d617069636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pulkitjalan/google-apiclient)

Requirements
------------

[](#requirements)

This package requires PHP &gt;=5.4

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

[](#installation)

Install via composer - edit your `composer.json` to require the package.

```
"require": {
    "pulkitjalan/google-apiclient": "3.*"
}
```

Then run `composer update` in your terminal to pull it in.

Or use `composer require pulkitjalan/google-apiclient`

Laravel
-------

[](#laravel)

To use in laravel add the following to the `providers` array in your `config/app.php`

```
PulkitJalan\Google\GoogleServiceProvider::class
```

Next add the following to the `aliases` array in your `config/app.php`

```
'Google' => PulkitJalan\Google\Facades\Google::class
```

Finally run `php artisan vendor:publish --provider="PulkitJalan\Google\GoogleServiceProvider" --tag="config"` to publish the config file.

#### Looking for a Laravel 4 compatible version?

[](#looking-for-a-laravel-4-compatible-version)

Checkout the [1.0 branch](https://github.com/pulkitjalan/google-apiclient/tree/1.0)

Usage
-----

[](#usage)

The `Client` class takes an array as the first parameter, see example of config file below:

```
return [
    /*
    |----------------------------------------------------------------------------
    | Google application name
    |----------------------------------------------------------------------------
    */
    'application_name' => '',

    /*
    |----------------------------------------------------------------------------
    | Google OAuth 2.0 access
    |----------------------------------------------------------------------------
    |
    | Keys for OAuth 2.0 access, see the API console at
    | https://developers.google.com/console
    |
    */
    'client_id' => '',
    'client_secret' => '',
    'redirect_uri' => '',
    'scopes' => [],
    'access_type' => 'online',
    'approval_prompt' => 'auto',

    /*
    |----------------------------------------------------------------------------
    | Google developer key
    |----------------------------------------------------------------------------
    |
    | Simple API access key, also from the API console. Ensure you get
    | a Server key, and not a Browser key.
    |
    */
    'developer_key' => '',

    /*
    |----------------------------------------------------------------------------
    | Google service account
    |----------------------------------------------------------------------------
    |
    | Set the credentials JSON's location to use assert credentials, otherwise
    | app engine or compute engine will be used.
    |
    */
    'service' =>  [
        /*
        | Enable service account auth or not.
        */
        'enabled' => false,

        /*
        | Path to service account json file
        */
        'file' => '',
    ],
];
```

To use Google Cloud Platform services, enter the location to the service account JSON file **(not the JSON string itself)**. To use App Engine or Computer Engine, leave it blank.

From [Google's upgrading document](https://github.com/google/google-api-php-client/blob/master/UPGRADING.md):

> Note: P12s are deprecated in favor of service account JSON, which can be generated in the Credentials section of Google Developer Console.

Get `Google_Client`

```
$client = new PulkitJalan\Google\Client($config);
$googleClient = $client->getClient();
```

Laravel Example:

```
$googleClient = Google::getClient();
```

Get a service

```
$client = new PulkitJalan\Google\Client($config);

// returns instance of \Google_Service_Storage
$storage = $client->make('storage');

// list buckets example
$storage->buckets->listBuckets('project id');

// get object example
$storage->objects->get('bucket', 'object');
```

Laravel Example:

```
// returns instance of \Google_Service_Storage
$storage = Google::make('storage');

// list buckets example
$storage->buckets->listBuckets('project id');

// get object example
$storage->objects->get('bucket', 'object');
```

Have a look at [google/google-api-php-client-services](https://github.com/google/google-api-php-client-services) to get a full list of the supported Google Services.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 79.4% 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 ~72 days

Recently: every ~51 days

Total

14

Last Release

3180d ago

Major Versions

0.2.0 → 1.02015-08-08

1.0.x-dev → 2.02015-08-08

2.0.x-dev → 3.0.02016-07-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae0f7f1f69309bec448ac224b62d1eb8d0dd6e9477097d4a502cd0f78913042e?d=identicon)[macromindonline](/maintainers/macromindonline)

---

Top Contributors

[![pulkitjalan](https://avatars.githubusercontent.com/u/4124930?v=4)](https://github.com/pulkitjalan "pulkitjalan (27 commits)")[![avanderbergh](https://avatars.githubusercontent.com/u/493849?v=4)](https://github.com/avanderbergh "avanderbergh (2 commits)")[![tyteen4a03](https://avatars.githubusercontent.com/u/440015?v=4)](https://github.com/tyteen4a03 "tyteen4a03 (2 commits)")[![dreanmer](https://avatars.githubusercontent.com/u/5880810?v=4)](https://github.com/dreanmer "dreanmer (1 commits)")[![palpalani](https://avatars.githubusercontent.com/u/716695?v=4)](https://github.com/palpalani "palpalani (1 commits)")[![threesquared](https://avatars.githubusercontent.com/u/892142?v=4)](https://github.com/threesquared "threesquared (1 commits)")

---

Tags

laravelgooglecloud platform

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/macromindonline-google-apiclient/health.svg)

```
[![Health](https://phpackages.com/badges/macromindonline-google-apiclient/health.svg)](https://phpackages.com/packages/macromindonline-google-apiclient)
```

###  Alternatives

[pulkitjalan/google-apiclient

Google api php client wrapper with Cloud Platform and Laravel support

2582.9M5](/packages/pulkitjalan-google-apiclient)[revolution/laravel-google-sheets

Google Sheets API v4

4483.1M6](/packages/revolution-laravel-google-sheets)[thujohn/analytics

Google Analytics for Laravel 4

113108.7k1](/packages/thujohn-analytics)[schulzefelix/laravel-search-console

A Laravel package to retrieve data from Google Search Console

5037.8k1](/packages/schulzefelix-laravel-search-console)[scottybo/laravel-google-my-business

A package for Laravel which implements the Google My Business API

3360.3k](/packages/scottybo-laravel-google-my-business)

PHPackages © 2026

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