PHPackages                             edisonthk/google-oauth-laravel4 - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. edisonthk/google-oauth-laravel4

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

edisonthk/google-oauth-laravel4
===============================

Optimize artdarek/oauth-4-laravel with Google OAuth 2.0 for laravel 4

1.0.5(11y ago)15.1k1MITPHPPHP &gt;=5.3.0

Since Sep 18Pushed 11y agoCompare

[ Source](https://github.com/edisonthk/google-oauth-laravel4)[ Packagist](https://packagist.org/packages/edisonthk/google-oauth-laravel4)[ Docs](https://github.com/edisonthk/google-oauth-laravel4)[ RSS](/packages/edisonthk-google-oauth-laravel4/feed)WikiDiscussions master Synced yesterday

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

Google OAuth for Laravel 4
==========================

[](#google-oauth-for-laravel-4)

oauth-4-laravel is a simple laravel 4 Google OAuth 2.0 . It is integrated with [Lusitanian/PHPoAuthLib](https://github.com/Lusitanian/PHPoAuthLib) and [artdarek/oauth-4-laravel](https://github.com/artdarek/oauth-4-laravel)which provides oAuth 2.0 support in PHP 5.3+ for laravel 4.

---

Installation
============

[](#installation)

This package is available in packagist.org. You can install it by adding following in composer.json

```
"require": {
    "edisonthk/google-oauth-laravel4": "dev-master"
},

```

then, install it by

```
composer update

```

After finish installed, import service provider and alias in app/config/app.php

```
'providers' => array(
	'Edisonthk\GoogleOAuth\GoogleOAuthServiceProvider',
)

 :
 :

'aliases' => array(
	'GoogleOAuth'	=> 'Edisonthk\GoogleOAuth\Facade\GoogleOAuth',
)
```

Configuration &amp; Credentials
===============================

[](#configuration--credentials)

Get your client\_secret and client\_id from Google Developers Console. Then, configure it with laravel. There are 2 options you can configure with it.

### Option 1:

[](#option-1)

Create config file by artisan command.

```
$ php artisan config:publish edisonthk/google-oauth-laravel4

```

Then, config file will be generated at app/config/packages/edisonthk/google-oauth-laravel4/config.php. Fill it in with your client\_secret, cliend\_id, redirect\_url and scope.

### Option 2:

[](#option-2)

Create a config file called google-oauth-laravel4.php in app/config directory. Then add following code and fill in your client\_secret, cliend\_id and redirect\_url.

```
