PHPackages                             ncsuwebdev/gclient - 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. ncsuwebdev/gclient

ActiveLibrary[API Development](/categories/api)

ncsuwebdev/gclient
==================

Google API Client Wrapper for Laravel 5.6+ support

1.02(2y ago)14071PHPPHP ^5.6|^7.0|^8.0

Since Mar 6Pushed 2y ago4 watchersCompare

[ Source](https://github.com/ncsuwebdev/gclient)[ Packagist](https://packagist.org/packages/ncsuwebdev/gclient)[ RSS](/packages/ncsuwebdev-gclient/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (5)Versions (8)Used By (0)

Google API Client for Laravel
=============================

[](#google-api-client-for-laravel)

The `ncsuwebdev/gclient` package allows you to more easily integrate the use of Google APIs into your Laravel Application. This package's original focus was aiding in the development of applications that needed tighter integration with an organization's G Suite domain to provide domain management and support. However, this package can be used for other Google APIs.

This package was inspired by the [Google API Client Wrapper](https://github.com/pulkitjalan/google-apiclient) package.

- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
    - [Setup Credential File Storage](#setup-credential-file-storage)
    - [Create Project in Google Developer Console](#create-project-in-google-developer-console)
    - [Initialize Configuration Variables](#initialize-configuration-variables)
- [Authorization](#authorization)

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

[](#requirements)

- PHP ^5.6|^7.0|^8.0
- Laravel &gt;5.6

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

[](#installation)

You can install the package via composer:

```
composer require ncsuwebdev/gclient

```

The package will automatically register itself.

Configuration
-------------

[](#configuration)

There are numerous steps to get API credentials properly working with the Google API.

### Setup Credential File Storage

[](#setup-credential-file-storage)

The Google API will provide several json files used to store credentials. These should be stored outside your web-servicable directory space. We recommend creating a new directory called `googleapi` in the root of your project. You can name this whatever you'd like but be sure to reference it properly in the config file.

### Create Project in Google Developer Console

[](#create-project-in-google-developer-console)

Visit the [Google Developer Console](https://console.developers.google.com/) to create a new project that will have it's own API credentials.

1. Specify the necessary API scopes for your project. *Make note of the API's selected to ensure you can add them to the config file.*
2. Setup an OAuth 2.0 client ID with application type of Other. Once setup is complete, download the client\_secrets.json file and save to the `googleapi` directory.

#### Domain Wide Delegation

[](#domain-wide-delegation)

If working with a G Suite domain and **Domain Wide Delegation** is needed, you'll need to setup and configure a Service Account inside the Developer Console along with an associated user. Download the provided `oauth2service.json` file and save it to the `googleapi` directory.

You'll also need to authorize the API scope list for the service account client ID inside the G Suite Admin Console. [Check out the wiki](https://github.com/ncsuwebdev/gclient/wiki/Google-API-Scopes-for-Delegate-Admin-Access) for a default list to get you started.

### Initialize Configuration Variables

[](#initialize-configuration-variables)

You may optionally run

```
php artisan vendor:publish --provider="NCSU\GClient\GoogleClientServiceProvider" --tag="config"

```

To publish a copy of the default configuration values into your application. If you wish to alter any of the Google API Scopes used, you'll need to publish a configuration file.

You'll need to configure the following configuration values in your .env file:

- GOOGLE\_APP\_NAME
- GOOGLE\_CLIENT\_ID
- GOOGLE\_CLIENT\_SECRET
- GOOGLE\_SERVICE\_ACCOUNT\_NAME
- GOOGLE\_SERVICE\_ACCOUNT\_JSON
- GOOGLE\_CUSTOMER\_ID
- GOOGLE\_DOMAIN\_NAME
- GOOGLE\_SECRETS\_FROM\_BASE\_PATH
- GOOGLE\_CREDENTIALS\_PATH
- GOOGLE\_TOKEN\_PATH

#### Multiple Domains

[](#multiple-domains)

If you need to handle multiple domains but don't want to worry about constantly changing your .env or credentials file, you can set `GOOGLE_ENV` in your `.env` file to be a string that will prefix your config variables.

For example if you set `GOOGLE_ENV='TESTING'` the config file will search for the necessary variables prefixed with `TESTING_` such as `TESTING_GOOGLE_CLIENT_ID`.

Authorization
-------------

[](#authorization)

To authorize your application to talk to the Google API run the following command:

```
php artisan gclient:authorize

```

Follow the prompts to authorize API access using the Google Account that you used with the developer console.

If you change any API scopes after authorization, you should run

```
php artisan gclient:authorize --reauth

```

to grab a fresh token with the proper scopes.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 72.7% 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 ~256 days

Recently: every ~384 days

Total

7

Last Release

1083d ago

Major Versions

0.2.3 → 1.012022-05-10

1.01 → v8.x-dev2022-05-10

PHP version history (2 changes)0.2PHP ^7.1.3

0.2.3PHP ^5.6|^7.0|^8.0

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/30595f7fe2c9ddfefcbd3e756d69b89240b17eeff99d7791d74e91f6dc8c54d6?d=identicon)[jlmaners](/maintainers/jlmaners)

---

Top Contributors

[![jlmaners](https://avatars.githubusercontent.com/u/582807?v=4)](https://github.com/jlmaners "jlmaners (8 commits)")[![flashadvocate](https://avatars.githubusercontent.com/u/7848492?v=4)](https://github.com/flashadvocate "flashadvocate (3 commits)")

---

Tags

laravelgooglencstatencsu

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/ncsuwebdev-gclient/health.svg)

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

###  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)[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)[tomshaw/google-api

A Laravel Google API Client.

591.5k](/packages/tomshaw-google-api)

PHPackages © 2026

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