PHP code example of socialiteproviders / wechat-service-account
1. Go to this page and download the library: Download socialiteproviders/wechat-service-account 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/ */
socialiteproviders / wechat-service-account example snippets
'wechat_service_account' => [
'client_id' => env('WECHATSERVICEACCOUNT_CLIENT_ID'),
'client_secret' => env('WECHATSERVICEACCOUNT_CLIENT_SECRET'),
'redirect' => env('WECHATSERVICEACCOUNT_REDIRECT_URI')
],
Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
$event->extendSocialite('wechat_service_account', \SocialiteProviders\WeChatServiceAccount\Provider::class);
});
protected $listen = [
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
// ... other providers
\SocialiteProviders\WeChatServiceAccount\WeChatServiceAccountExtendSocialite::class.'@handle',
],
];
return Socialite::driver('wechat_service_account')->redirect();