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

ActiveLibrary[API Development](/categories/api)

pulkitjalan/google-apiclient
============================

Google api php client wrapper with Cloud Platform and Laravel support

6.3.1(1y ago)2582.9M—0.8%77[4 PRs](https://github.com/pulkitjalan/google-apiclient/pulls)5MITPHPPHP &gt;=8.0CI passing

Since Jan 25Pushed 1mo ago9 watchersCompare

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

READMEChangelog (10)Dependencies (4)Versions (26)Used By (5)

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

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

> Google api php client wrapper with Cloud Platform and Laravel support

[![Latest Stable Version](https://camo.githubusercontent.com/2d8536cddd3315a45965026efc52b55390824ab8db623bd734d804235bf0a750/68747470733a2f2f706f7365722e707567782e6f72672f70756c6b69746a616c616e2f676f6f676c652d617069636c69656e742f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/pulkitjalan/google-apiclient)[![MIT License](https://camo.githubusercontent.com/30597ff9a350144f03bffdd9183e16468e0b3ca1193e1d08591d992622738d55/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://www.opensource.org/licenses/MIT)[![Run Tests](https://github.com/pulkitjalan/google-apiclient/actions/workflows/run-tests.yml/badge.svg)](https://github.com/pulkitjalan/google-apiclient/actions/workflows/run-tests.yml)[![Coverage](https://camo.githubusercontent.com/60345825b591f944fa2796fec08cfe69d516869d700a2983bab78b8b8ae1483b/68747470733a2f2f636f6465636f762e696f2f67682f70756c6b69746a616c616e2f676f6f676c652d617069636c69656e742f67726170682f62616467652e7376673f746f6b656e3d64706a5a3454737a786d)](https://codecov.io/gh/pulkitjalan/google-apiclient)[![Total Downloads](https://camo.githubusercontent.com/6d5fc52e30b2445d0029507390e48b38ba776c8565f53ec09c2d470945887ab7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70756c6b69746a616c616e2f676f6f676c652d617069636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pulkitjalan/google-apiclient)

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

[](#requirements)

- PHP &gt;=8.0

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

[](#installation)

Install via composer

```
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.

#### Using an older version of PHP / Laravel?

[](#using-an-older-version-of-php--laravel)

If you are on a PHP version below 8.0 or a Laravel version below 10.0, use an older version of this package.

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',
    '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' => '',
    ],

    /*
    |----------------------------------------------------------------------------
    | Additional config for the Google Client
    |----------------------------------------------------------------------------
    |
    | Set any additional config variables supported by the Google Client
    | Details can be found here:
    | https://github.com/google/google-api-php-client/blob/master/src/Google/Client.php
    |
    | NOTE: If client id is specified here, it will get over written by the one above.
    |
    */
    'config' => [],
];
```

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');
// or
$storage = Google::make(\Google\Service\Storage::class);

// 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

64

—

FairBetter than 99% of packages

Maintenance69

Regular maintenance activity

Popularity61

Solid adoption and visibility

Community34

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 62.9% 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 ~167 days

Recently: every ~260 days

Total

23

Last Release

451d ago

Major Versions

1.0.x-dev → 2.02015-08-08

2.0.x-dev → 3.0.02016-07-20

3.1.4 → 4.0.02019-09-06

4.1.1 → 5.0.02022-02-16

5.0.0 → 6.0.02022-04-18

PHP version history (5 changes)0.1.0PHP &gt;=5.4.0

4.0.0PHP ^7.2

5.0.0PHP ^7.2|^8.0

6.0.0PHP ^8.0

6.1.0PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4124930?v=4)[Pulkit Jalan](/maintainers/pulkitjalan)[@pulkitjalan](https://github.com/pulkitjalan)

---

Top Contributors

[![pulkitjalan](https://avatars.githubusercontent.com/u/4124930?v=4)](https://github.com/pulkitjalan "pulkitjalan (44 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![tyteen4a03](https://avatars.githubusercontent.com/u/440015?v=4)](https://github.com/tyteen4a03 "tyteen4a03 (2 commits)")[![avanderbergh](https://avatars.githubusercontent.com/u/493849?v=4)](https://github.com/avanderbergh "avanderbergh (2 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![matthewnessworthy](https://avatars.githubusercontent.com/u/5653887?v=4)](https://github.com/matthewnessworthy "matthewnessworthy (2 commits)")[![idsulik](https://avatars.githubusercontent.com/u/3595194?v=4)](https://github.com/idsulik "idsulik (1 commits)")[![kawax](https://avatars.githubusercontent.com/u/1502086?v=4)](https://github.com/kawax "kawax (1 commits)")[![threesquared](https://avatars.githubusercontent.com/u/892142?v=4)](https://github.com/threesquared "threesquared (1 commits)")[![amcfarlane](https://avatars.githubusercontent.com/u/2536236?v=4)](https://github.com/amcfarlane "amcfarlane (1 commits)")[![negoziator](https://avatars.githubusercontent.com/u/2228675?v=4)](https://github.com/negoziator "negoziator (1 commits)")[![palpalani](https://avatars.githubusercontent.com/u/716695?v=4)](https://github.com/palpalani "palpalani (1 commits)")[![dpslwk](https://avatars.githubusercontent.com/u/234460?v=4)](https://github.com/dpslwk "dpslwk (1 commits)")[![sietzekeuning](https://avatars.githubusercontent.com/u/11088108?v=4)](https://github.com/sietzekeuning "sietzekeuning (1 commits)")[![stevelacey](https://avatars.githubusercontent.com/u/289531?v=4)](https://github.com/stevelacey "stevelacey (1 commits)")[![dreanmer](https://avatars.githubusercontent.com/u/5880810?v=4)](https://github.com/dreanmer "dreanmer (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelgooglecloud platform

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[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)
