Package Data | |
---|---|
Maintainer Username: | bonbon1702 |
Maintainer Contact: | tuannghia1702@gmail.com (Nghiavt) |
Package Create Date: | 2014-11-30 |
Package Last Update: | 2014-12-04 |
Home Page: | |
Language: | PHP |
License: | Unknown |
Last Refreshed: | 2025-01-14 03:00:04 |
Package Statistics | |
---|---|
Total Downloads: | 97 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 3 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
"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);
}
});
});