original_string: public function requestToken($code)
      {
          $parameters = [
              'client_id' => config('twitch-api.client_id'),
              'client_secret' => config('twitch-api.client_secret'),
              'redirect_uri' => config('twitch-api.redirect_url'),
              'code' => $code,
              'grant_type' => 'authorization_code'
          ];
  
          try {
              $client = new Client();
  
              $response = $client->post(config('twitch-api.api_url') . '/kraken/oauth2/token', ['body' => $parameters]);
  
              $response = $response->json();
  
              if (isset($response[ 'access_token' ])) {
  
                  return $response[ 'access_token' ];
              }
  
          } catch (\Exception $e) {
  
              throw $e;
          }
      }
code: public function requestToken($code)
      {
          $parameters = [
              'client_id' => config('twitch-api.client_id'),
              'client_secret' => config('twitch-api.client_secret'),
              'redirect_uri' => config('twitch-api.redirect_url'),
              'code' => $code,
              'grant_type' => 'authorization_code'
          ];
  
          try {
              $client = new Client();
  
              $response = $client->post(config('twitch-api.api_url') . '/kraken/oauth2/token', ['body' => $parameters]);
  
              $response = $response->json();
  
              if (isset($response[ 'access_token' ])) {
  
                  return $response[ 'access_token' ];
              }
  
          } catch (\Exception $e) {
  
              throw $e;
          }
      }
code_tokens: public function requestToken ( $ code ) { $ parameters = [ 'client_id' => config ( 'twitch-api.client_id' ) , 'client_secret' => config ( 'twitch-api.client_secret' ) , 'redirect_uri' => config ( 'twitch-api.redirect_url' ) , 'code' => $ code , 'grant_type' => 'authorization_code' ] ; try { $ client = new Client ( ) ; $ response = $ client -> post ( config ( 'twitch-api.api_url' ) . '/kraken/oauth2/token' , [ 'body' => $ parameters ] ) ; $ response = $ response -> json ( ) ; if ( isset ( $ response [ 'access_token' ] ) ) { return $ response [ 'access_token' ] ; } } catch ( \ Exception $ e ) { throw $ e ; } }
docstring: Requests a token for a given code
  
  @param $code
  
  @return mixed
  @throws \Exception
docstring_tokens: Requests a token for a given code