hyancat / socialite-baidu
v1.0
2015-08-29 14:22 UTC
Requires
- php: >=5.5.0
- socialiteproviders/manager: ~1.0
This package is auto-updated.
Last update: 2024-11-15 23:01:49 UTC
README
百度 OAuth2 账号连接 for Laravel 5.x.
Installation
-
安装 composer package:
composer require hyancat/socialite-baidu
-
config/app.php 中
Laravel\Socialite\SocialiteServiceProvider
替换成SocialiteProviders\Manager\ServiceProvider
-
app/Providers/EventServiceProvider.php
中添加一个监听器:SocialiteProviders\Manager\SocialiteWasCalled
,如果已存在则忽略;并添加监听响应事件:Hyancat\SocialiteBaidu\BaiduExtendSocialite@handle
'SocialiteProviders\Manager\SocialiteWasCalled' => [ // ... 'Hyancat\SocialiteBaidu\BaiduExtendSocialite@handle', ],
-
config/service.php 中添加一个配置项:
'baidu' => [ 'client_id' => env('BAIDU_KEY'), 'client_secret' => env('BAIDU_SECRET'), 'redirect' => env('BAIDU_REDIRECT_URL'), ],
Usage
详见官方文档 socialite 用法。
License
MIT License.