PHPackages                             baffo/googleapi - 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. baffo/googleapi

ActiveLibrary[API Development](/categories/api)

baffo/googleapi
===============

A Google API v3 wrapper for Laravel 4.x with multiple Google Client IDs support

1.0(11y ago)114MITPHPPHP &gt;=5.2.1

Since Jun 30Pushed 11y ago1 watchersCompare

[ Source](https://github.com/baffo/googleapi-laravel)[ Packagist](https://packagist.org/packages/baffo/googleapi)[ Docs](https://github.com/PongoCMS/googleapi-laravel)[ RSS](/packages/baffo-googleapi/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

This Package has been forked to allow it to work with illuminate 4.2.\* and to add support for multiple Google Client IDs, to seemlessly enable us to switch between multiple working environments

Requires an additional config variable to be specified in your `/app/config/app.php` file:

```
// app/config/app.php

'...',
'environment' => 'local', // local, prod, ...
```

A Google API v3 wrapper for Laravel 4
=====================================

[](#a-google-api-v3-wrapper-for-laravel-4)

This package enables a Laravel flavoured way to manage Google services through its API interface (v3)

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

[](#installation)

Add the required package to your composer.json file

```
{
    "require": {
    	...
    		"google/apiclient": "dev-master",
		"pongocms/googleapi": "dev-master"
	}
}
```

...then just run `composer update`

Laravel implementation
----------------------

[](#laravel-implementation)

This package includes a ServiceProvider that will give access to a helpful `GoogleAPI` facade. Set the `GoogleapiServiceProvider` reference in your `/app/config/app.php` like this:

```
// app/config/app.php

'providers' => array(
    '...',
    'Pongo\GoogleAPI\GoogleapiServiceProvider'
);
```

### Export and edit the configuration file

[](#export-and-edit-the-configuration-file)

Before using this package, you will need to activate a profile from Google developer and get your personal code from the [Google Developers Console](https://console.developers.google.com/) in order to obtain access and use their services through API calls.

Once obtained `Client ID` and `Client Secret` strings for web application from the Google Developers Console and set a valid `Redirect URI` callback, export the package config file:

`php artisan config:publish pongocms/googleapi`

...and put them to the oauth2 parameters into the config file

```
// app/config/packages/pongocms/googleapi/config.php

return array(

    // OAuth2 Setting, you can get these keys in Google Developers Console
    'oauth2_client_id'      => '< YOUR CLIENT ID >',
    'oauth2_client_secret'  => '< YOUR CLIENT SECRET >',
    'oauth2_redirect_uri'   => 'http://localhost:8000/',   // Change it according to your needs

    ...
  );
```

Set also the correct `scope` for the services you will use in your application (and remember to activate related APIs inside the Google Developers Console =&gt; APIS &amp; AUTH =&gt; APIs). Refer to [Google API](https://developers.google.com/google-apps/app-apis) wiki for any help.

Using the GoogleAPI facade
--------------------------

[](#using-the-googleapi-facade)

Once everything set correctly, you'll gain access to the `GoogleAPI` facade in a pure Laravel style.

### Need to use the Google Calendar service?

[](#need-to-use-the-google-calendar-service)

```
// routes.php

Route::get('/', function()
{
   if ( Input::has('code') )
   {
   	$code = Input::get('code');

   	// authenticate with Google API
   	if ( GoogleAPI::authenticate($code) )
   	{
   		return Redirect::to('/protected');
   	}
   }

   // get auth url
   $url = GoogleAPI::authUrl();

   return link_to($url, 'Login with Google!');
});

Route::get('/logout', function()
{
   // perform a logout with redirect
   return GoogleAPI::logout('/');
});

Route::get('/protected', function()
{
   // Get the google service (related scope must be set)
   $service = GoogleAPI::getService('Calendar');

   // invoke API call
   $calendarList = $service->calendarList->listCalendarList();

   foreach ( $calendarList as $calendar )
   {
   	echo "{$calendar->summary} ";
   }

   return link_to('/logout', 'Logout');
});
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.5% 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

Unknown

Total

1

Last Release

4338d ago

### Community

Maintainers

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

---

Top Contributors

[![redbaron76](https://avatars.githubusercontent.com/u/1061849?v=4)](https://github.com/redbaron76 "redbaron76 (26 commits)")[![baffo](https://avatars.githubusercontent.com/u/109480?v=4)](https://github.com/baffo "baffo (8 commits)")

---

Tags

apilaravelgooglelaravel4v3googleapi

### Embed Badge

![Health badge](/badges/baffo-googleapi/health.svg)

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

###  Alternatives

[thujohn/analytics

Google Analytics for Laravel 4

113108.7k1](/packages/thujohn-analytics)[hosseinhezami/laravel-gemini

A production-ready Laravel package to integrate with the Google Gemini API. Supports text, image, video, audio, long-context, structured output, files, caching, function-calling and understanding capabilities.

14010.8k1](/packages/hosseinhezami-laravel-gemini)[mbarwick83/shorty

Google Url Shortener API Package for Laravel 5.1

31204.9k](/packages/mbarwick83-shorty)[teepluss/api

Laravel 4 Internal Request (HMVC)

7034.0k](/packages/teepluss-api)[gemini-api-php/laravel

Gemini API client for Laravel

8915.7k](/packages/gemini-api-php-laravel)[schulzefelix/laravel-search-console

A Laravel package to retrieve data from Google Search Console

5037.8k1](/packages/schulzefelix-laravel-search-console)

PHPackages © 2026

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