PHPackages                             dev-ratna/phalcon-social - 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. dev-ratna/phalcon-social

ActiveLibrary

dev-ratna/phalcon-social
========================

a phalcon component to implement social logins

6161PHP

Since May 9Pushed 9y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Phalcon Social
==============

[](#phalcon-social)

Social Login Wrapper for Phalcon (Based on Laravel's Socialite)

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

[](#installation)

```
composer require dev-ratna/phalcon-social
```

Configration
------------

[](#configration)

the wrapper by deafault searches for `social` key in the main config file.

the config should use keys `facebook`, `google` or depending on the alias of the provider.

```
'social' => [
  'facebook' => [
        'client_id' => 'client-id-here',
        'client_secret' => 'client-secret-here',
        'redirect_uri' => 'url/to/redirect'
    ],
    'google' => [
        'client_id' => 'example-id',
        'client_secret' => 'example-secret',
        'redirect_uri' => 'url/to/redirect'
    ]
  ]
```

Usage
-----

[](#usage)

The Service

```
use PhalconSocial\PhalconSocial;

$di->setShared('socialLogin', function(){
    $socialLogin = new SocialLogin();
    return $socialLogin;

});
```

The routes

```
$router->add('/social/oauth/redirect', [
	'controller' => 'controller',
	'action' => 'redirect'
]);

$router->add('/social/oauth/login', [
	'controller' => 'controller',
	'action' => 'login'
]);
```

In the Controller

```
