New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

redbaron76/googlavel

a Google API v3 wrapper for Laravel 4.x
920 8

Larablocks Analysis

redbaron76/googlavel works with Laravel 4 (latest release 1.0, Sep 11, 2014), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 4, past end of life
  • No release in the last 12 months (last: Sep 11, 2014)
  • 0 downloads a month (needs 10,000)
  • 8 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Sep 11, 2014.
  • No releases in the last 12 months.
  • First released: Sep 11, 2014.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.

Install
composer require redbaron76/googlavel
Latest Version:1.0
PHP:>=5.4
Laravel:4
License:MIT
Last Updated:Sep 11, 2014
Links: GitHub  ·  Packagist
Maintainer: Redbaron76

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

Add the required package to your composer.json file

{
    "require": {
    	...
		"redbaron76/googlavel": "1.0"
	}
}

Set minimum-stability to 'dev'

In order to avoid Composer's possible conflicts, just set your composer.json 'minimum-stability' to 'dev'

{
	...
    "minimum-stability": "dev"
}

...then just run composer update

Laravel implementation

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


// app/config/app.php

'providers' => array(
    '...',
    'Redbaron76\Googlavel\GooglavelServiceProvider'
);

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 in order to obtain access and use their services through API calls.

Google Developers Console

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

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


// app/config/packages/redbaron76/googlavel/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:8081/',   // 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 => APIS & AUTH => APIs). Refer to Google API wiki for any help.

Using the Googlavel facade

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

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 ( Googlavel::authenticate($code) )
   	{
   		return Redirect::to('/protected');
   	}
   }
   
   // get auth url
   $url = Googlavel::authUrl();
   
   return link_to($url, 'Login with Google!');
});

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

Route::get('/protected', function()
{
   // Get the google service (related scope must be set)
   $service = Googlavel::getService('Calendar');
   
   // invoke API call
   $calendarList = $service->calendarList->listCalendarList();

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

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

Related Packages

poniverse/api

PHP Library to access the Poniverse APi

288 2
thujohn/analytics

Google Analytics for Laravel 4

108,745 110
ozankurt/google-core

Laravel 5 Google Core

18,285 1
altelma/laravel-mailchimp

A packages provide you to connect with mailchimp API v3, so easiest.

6,149 5
prspace/mailjet

Mailjet driver for Laravel

317 2

Version History

Version Released PHP Laravel License
1.0 >=5.4 ~4.1 MIT