/**
  * Retrieves, via ipinfodb.com, user get location using IP
  * @return json
  */
 private function getSubmitterGeoLocation()
 {
     $url = 'http://api.ipinfodb.com/v3/ip-city/?';
     $url .= 'key=' . env('IP_INFO_DB_KEY');
     $url .= '&ip=' . $_SERVER['REMOTE_ADDR'];
     $url .= '&format=json';
     $response = \Curl::to($url)->get();
     return json_decode($response, true);
 }
Example #2
0
 public function testAuth()
 {
     $response = Curl::to('http://localhost/Bowling/public/api/leagues')->get();
     $authMessage = '"Please enter valid Authentication Token"';
     $this->assertEquals($authMessage, $response);
 }