PHPackages                             cresjie/social-login - 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. cresjie/social-login

ActiveLaravel-package[Authentication &amp; Authorization](/categories/authentication)

cresjie/social-login
====================

Laravel authentication with Social Services API

1.0.0.0(11y ago)5552PHPPHP &gt;=5.4.0

Since Feb 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/cresjie/social-login)[ Packagist](https://packagist.org/packages/cresjie/social-login)[ RSS](/packages/cresjie-social-login/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Social Login
============

[](#social-login)

Laravel 4 Authentication with Social Services API (OAuth2) like **Google, Facebook, Yahoo, Github**

---

Installation via Composer
-------------------------

[](#installation-via-composer)

Add this to your composer.json file, in the require object:

```
 "cresjie/social-login": "v1.0.0.0"
```

After that, run composer install to install the package.

Add the service provider to app/config/app.php, within the providers array.

```
 'providers' => array(
	...
	'Cresjie\SocialLogin\SocialLoginServiceProvider'
)
```

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

[](#configuration)

Publish the default config file to your application so you can make modifications.

```
$ php artisan config:publish cresjie/social-login

```

Add your service provider credentials to the published config file:

```
 app/config/packages/cresjie/social-login/config.php

```

for formality set your redirect callback credential to something like: [www.mysite.com/login/google/callback](http://www.mysite.com/login/google/callback)see \*\*Basic usage -&gt; Authentication \*\*

BASIC USAGE
-----------

[](#basic-usage)

\##Login Page

```
Route::get('/login/{provider}',function($provider){
	return SocialLogin::login($provider);
});
```

where **provider** is a social service like google, facebook, etc.. this would redirect the user to the login page for the that social service.

\##Authentication

```
Route::get('/login/{provider}/callback',function($provider){
	var_dump( SocialLogin::authenticate($provider) );
});
```

after the user logs in to his social service. He/she will be redirected to the url specified in your *config file redirect*, and just call the **SocialLogin::authenticate($provider)** to retrieve information

Other Usage
-----------

[](#other-usage)

you can also filter results in the *config file* to have uniform calls. For example retrieving profile picture in google has an array key of *picture* while in github has an array key of *avatar\_url*

```
Route::get('/login/{provider}/callback',function($provider){
	$results = SocialLogin::authenticate($provider);

	echo $results['picture']; // for goole
	echo $results['avatar_url']; //for github

});
```

how about a uniform call.

```
Route::get('/login/{provider}/callback',function($provider){
	$results = SocialLogin::authenticate($provider);

	echo $results['image']; //uniform call

});
```

how? just set **filter\_result** in the *config file* with something like:

```
 [
				...
				'filter_result' => function($result){
					$result['image'] = $result['picture'];
					return $result; //should have return value
				}
		],

		'github' => [
			...
			'filter_result' => function($result){
				$result['image'] = $result['avatar_url'];
				return $result;
			}
		]
];
```

we've just add another key to the *result value* to have a uniform call.. cool!

Access Token
------------

[](#access-token)

After the user successfully authenticate the login. You can get the access token by calling the method: **SocialLogin::getAccessToken()**

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

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

4094d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/69da713eaacadfbe5b0825dd9e1c239490d6cbfe31985aeffd7e78041ced8a7a?d=identicon)[cresjie](/maintainers/cresjie)

---

Top Contributors

[![cresjie](https://avatars.githubusercontent.com/u/8773060?v=4)](https://github.com/cresjie "cresjie (15 commits)")

---

Tags

laravelfacebookgoogleoauthoauth2githubsocialyahooSocial LoginsocialLogin

### Embed Badge

![Health badge](/badges/cresjie-social-login/health.svg)

```
[![Health](https://phpackages.com/badges/cresjie-social-login/health.svg)](https://phpackages.com/packages/cresjie-social-login)
```

###  Alternatives

[hwi/oauth-bundle

Support for authenticating users using both OAuth1.0a and OAuth2 in Symfony.

2.4k21.5M69](/packages/hwi-oauth-bundle)[and/oauth

Simple and amazing OAuth library with many providers. Just try it out!

4645.2k2](/packages/and-oauth)

PHPackages © 2026

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