/**
  * Register the service provider.
  */
 public function register()
 {
     $this->app->singleton('hearthstone-api', function ($app) {
         $client = new Client();
         return $client->cards();
     });
     $this->mergeConfig();
 }
Пример #2
0
 /**
  * @param $path
  * @param array $parameters
  *
  * @return mixed
  */
 public function getRequest($path, array $parameters = [])
 {
     $parameters = $this->configureOptions($parameters);
     $response = $this->client->getHttpClient()->get($path, $parameters);
     return json_decode($response->getBody(), true);
 }