2017 © Pedro Peláez
 

library tiupsdk-laravel

laravel tiup sdk

image

tiup/tiupsdk-laravel

laravel tiup sdk

  • Wednesday, July 19, 2017
  • by tiup
  • Repository
  • 1 Watchers
  • 0 Stars
  • 60 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

TiUP SDK for Laravel

Installation

composer require tiup/tiupsdk-laravel 

配置

修改 config/app.php, (*1)

在providers中增加, (*2)

Tiup\LaravelTiupSdk\LaravelTiupSdkServiceProvider::class,

在 aliases 中增加, (*3)

'Tiup' => Tiup\LaravelTiupSdk\TiupFacade::class,

运行下面复制配置文件到 config目录。

php artisan vendor:publish  --provider="Tiup\LaravelTiupSdk\LaravelTiupSdkServiceProvider"

.env 增加以下配置

TIUP_CLIENT_ID=client_id
TIUP_CLIENT_SECRET=client_secret
TIUP_AUTH_HOST=https://test.tiup.cn/
TIUP_API_HOST=https://test.tiup.cn/

运行 php artisan serve 启动即可, (*4)

应用首页 http://127.0.0.1:8000, (*5)

登录回调 http://127.0.0.1:8000/oauth/callback, (*6)

代码示例, (*7)


Route::get('/', function () { //获取登录地址 $url = Tiup::getAuthorizationUrl('http://127.0.0.1:8000/oauth/callback'); return redirect($url); }); Route::get('/oauth/callback', function () { //登录成功回调,获取用户信息 $token = \Tiup::getAccessToken(); $userinfo = \Tiup::me($token); dd($userinfo); });

The Versions

19/07 2017

dev-master

9999999-dev

laravel tiup sdk

  Sources   Download

TiUP

The Requires

 

19/07 2017

0.3

0.3.0.0

laravel tiup sdk

  Sources   Download

TiUP

The Requires

 

19/07 2017

0.4

0.4.0.0

laravel tiup sdk

  Sources   Download

TiUP

The Requires

 

26/05 2017

0.2

0.2.0.0

laravel tiup sdk

  Sources   Download

TiUP

The Requires

 

26/05 2017

0.1

0.1.0.0

laravel tiup sdk

  Sources   Download

The Requires