sourcescript / social-connect
该包最新版本(dev-master)没有提供许可证信息。
dev-master
2014-08-29 13:06 UTC
Requires
- php: >=5.4.0
- ext-curl: *
- illuminate/support: 4.2.*
This package is not auto-updated.
Last update: 2024-09-24 01:30:57 UTC
README
#SocialConnect ##由Sourcescript Innovations为Laravel创建
#安装,在composer.json中添加以下内容 "sourcescript/social-connect": "dev-master"
。执行composer update --prefer-dist
。
将以下内容添加到config/app.php
###外观
<?php 'Facebook' => 'Sourcescript\SocialConnect\Facades\Facebook'
###提供者
<?php ... 'Sourcescript\SocialConnect\SocialConnectServiceProvider' ...
安装后,您需要进行以下操作才能使用配置文件。
php artisan config:publish sourcescript/social-connect
您将获得一个如下所示的空白配置文件
<?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' => '' ] ] ];
##如何使用SocialConnect进行登录
<?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); ...
##如何在SocialConnect中获取用户资料
<?php //returns array Facebook::make()->getProfile(); //the parameter would be either 'me' (current user logged in) or any valid facebook username or ID
##如何在SocialConnect中获取用户的头像
<?php Facebook::make()->getProfileImage();
Twitter即将推出!