public function generateToken($code)
    {
        $this->token = $this->provider->getAccessToken('authorization_code', [
            'code' => $code
        ]);

        return $this->token;
    }
public function generateToken($code)
    {
        $this->token = $this->provider->getAccessToken('authorization_code', [
            'code' => $code
        ]);

        return $this->token;
    }
public function generateToken ( $ code ) { $ this -> token = $ this -> provider -> getAccessToken ( 'authorization_code' , [ 'code' => $ code ] ) ; return $ this -> token ; }
Generate a new access token object from an authorization code

@param  string $code Authorization code provided by the Unsplash OAuth2 service
@return \League\OAuth2\Client\Token\AccessToken
Generate a new access token object from an authorization code