29/08
2014
dev-master
9999999-dev
The Requires
- php >=5.4.0
- illuminate/support 4.2.*
- ext-curl *
by Sourcescript Innovations
Wallogit.com
2017 © Pedro Peláez
add the the following to your composer.json "sourcescript/social-connect": "dev-master". Do a composer update --prefer-dist., (*1)
Add the following to config/app.php:, (*2)
<?php
'Facebook' => 'Sourcescript\SocialConnect\Facades\Facebook'
<?php
...
'Sourcescript\SocialConnect\SocialConnectServiceProvider'
...
After the installation you have to do the following to be able to use the configuration fiels., (*3)
php artisan config:publish sourcescript/social-connect
You'll have a blank configuration file as follows, (*4)
<?php
return [
'facebook' => [
/**
* Your Application ID
* ==========================/
* Found in your application itself
*/
'app_id' => 'app_id',
/**
* Your Application Secret
* ==========================/
* Given By Facebook for auth purposes
*/
'app_secret' => 'app_secret',
/**
* SCOPES
* ==========================/
* Granted by facebook. Required scopes
* for facebook access
*/
'scopes' => [
],
/**
* Login Options
* ==========================/
* Login Callback Action after logging in
*/
'login' => [
'redirect_uri' => ''
]
]
];
<?php
...
//you should first fix the config file's login->redirect_uri to point to your callback function (That's where the script will go when the login function is all finished)
$facebook = Facebook::make();
$redirect_uri = '/facebook/login'; //the current route you want to point the login script
return $facebook->login($redirect_uri);
...
<?php //returns array Facebook::make()->getProfile(); //the parameter would be either 'me' (current user logged in) or any valid facebook username or ID
<?php
Facebook::make()->getProfileImage();
Twitter Soon!, (*5)