This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
<code><b>'providers' => 'Mahfuz05\LaravelOauth2\LaravelOauth2ServiceProvider'</b></code>
<br>
<code><b>'aliases' => 'LaravelOauth2' => 'Mahfuz05\LaravelOauth2\Facades\LaravelOauth2'</b></code>
if (!isset($_GET['code']))
{
$auth_url = LaravelOauth2::getAuthenticationUrl($this->url, $this->redirectUri);
header('Location: ' . $auth_url);
die('Redirect');
}
else
{
$params = array('code' => $_GET['code'], 'redirect_uri' => $this->redirectUri);
$response = LaravelOauth2::getAccessToken($this->token_url, 'authorization_code', $params);
//get Access Token and store it
LaravelOauth2::setAccessToken($response['result']['access_token']);
$token = $response['result']['access_token'];
//get all customers
$response = LaravelOauth2::fetch('https://api.debitoor.com/api/v1.0/customers');
}