PHP code example of xxutianyi / laravel-oauth-client
1. Go to this page and download the library: Download xxutianyi/laravel-oauth-client library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xxutianyi / laravel-oauth-client example snippets
//使用Facade
use Illuminate\Http\Request;
use XuDev\OAuthClient\Facade\OAuth
public function redirect(Request $request)
{
return OAuth::redirect($request, ['user:read']);
}
public function callback(Request $request)
{
$userInfo=OAuth::callback($request);
}
bash
#发布配置文件
php artisan vendor:publish --tag=oauth-client-config