/** * Register the service provider. * * @return void */ public function register() { $this->app->bind('open-weather', function ($app) { $config = $app->make('config'); /** @var array $defaults */ $defaults = $config->get('open-weather::options'); $baseUrl = $config->get('open-weather::base_url'); return OpenWeather::getInstance($defaults, $baseUrl); }); }
/** * Here in case you want to actually test the Open Weather API */ public function ActuallyTestWeather() { $openWeather = OpenWeather::getInstance($this->guzzleOpts, $this->baseUrl); $response = $openWeather->getByCityName('los angeles'); $this->assertTrue($response->isValid()); }