bonbon1702/facebooksdk is a Laravel package for easy way to use facebook sdk.
It currently has 3 GitHub stars and 97 downloads on Packagist.
Install it with composer require bonbon1702/facebooksdk.
Discover more Laravel packages by bonbon1702
or browse all Laravel packages to compare alternatives.
Last updated
"bonbon1702/facebooksdk": "dev-master"
Composer update
In app/config/app.php:
-Add providers
'bonbon1702\Facebook\FbServiceProvider',
-Add aliases
'Fb' => 'bonbon1702\Facebook\Facades\Fb',
php artisan config:publish bonbon1702/facebooksdk
app/config/packages/bonbon1702/facebooksdk/config.php
return array(
'app_id' => '',
'app_secret' => '',
'redirect_url' => url('facebook/callback'),
'scope' => array(
'publish_actions',
)
);
-Log in to Facebook
Fb::authenticate();
-Check login(return boolean)
Fb::check()
-Get user profile
Fb::getProfile()->asArray();
-Get user profile picture
Fb::getUserProfilePicture($type)->asArray();($type is square,small,normal,large);
-Publish posts to facebook
Fb::postToTimeLine($message, $link);
Route::group(['prefix' => 'facebook'], function ()
{
Route::get('connect', function ()
{
return Fb::authenticate();
});
Route::get('callback', function ()
{
$check = Fb::check();
if($check)
{
$profile = Fb::getProfile();
dd($profile);
}
});
});