PHP code example of socialiteproviders / steady
1. Go to this page and download the library: Download socialiteproviders/steady 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 / steady example snippets
'steady' => [
'client_id' => env('STEADY_CLIENT_ID'),
'client_secret' => env('STEADY_CLIENT_SECRET'),
'redirect' => env('STEADY_REDIRECT_URI')
],
Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
$event->extendSocialite('steady', \SocialiteProviders\Steady\Provider::class);
});
protected $listen = [
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
// ... other providers
\SocialiteProviders\Steady\SteadyExtendSocialite::class.'@handle',
],
];
return Socialite::driver('steady')->redirect();
$user = Socialite::driver('steady')->user();
$subscription = Socialite::driver('steady')->getSubscriptionByToken($user->token);
$state = $subscription['attributes']['state'] ?? null; // e.g. "active"
$token = Socialite::driver('steady')->refreshToken($refreshToken);
$token->token; // the new access token
$token->refreshToken; // rotate the stored refresh token
$token->expiresIn;