PHP code example of weann / socialite

1. Go to this page and download the library: Download weann/socialite 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/ */

    

weann / socialite example snippets


Weann\Socialite\SocialiteServiceProvider::class,

'Socialite' => Weann\Socialite\Facades\Socialite::class,

'wechat' => [
    'client_id' => 'APP_ID',
    'client_secret' => 'APP_SECRET',
    'redirect' => 'CALLBACK_URL'
],

Route::get('/', function () {
    return Socialite::driver('wechat')->redirect();
});

Route::get('callback', function () {
    $user = Socialite::driver('wechat')->user()
    dd($user);
});