public function get($toObject = false)
	{
        if(!env('GOOGLE_KEY')) {
            throw new Exception("Need an env key for geo request", 401);
        }

		$this->response = null;
		$this->error = null;

		if($this->c2a()) {
			$response = $this->template($toObject);
		}
		elseif($this->a2c()) {
			$response = $this->template($toObject);
		}
		elseif($this->i2c()) {
			$response = $this->template($toObject);
		}
		elseif($this->p2c()) {
			$response = $this->template($toObject);
		}

		if($response) {
			$this->reset();
			return $response;
		}

		throw new Exception(trans('location::errors.not_enough_data'));
	}
public function get($toObject = false)
	{
        if(!env('GOOGLE_KEY')) {
            throw new Exception("Need an env key for geo request", 401);
        }

		$this->response = null;
		$this->error = null;

		if($this->c2a()) {
			$response = $this->template($toObject);
		}
		elseif($this->a2c()) {
			$response = $this->template($toObject);
		}
		elseif($this->i2c()) {
			$response = $this->template($toObject);
		}
		elseif($this->p2c()) {
			$response = $this->template($toObject);
		}

		if($response) {
			$this->reset();
			return $response;
		}

		throw new Exception(trans('location::errors.not_enough_data'));
	}
public function get ( $ toObject = false ) { if ( ! env ( 'GOOGLE_KEY' ) ) { throw new Exception ( "Need an env key for geo request" , 401 ) ; } $ this -> response = null ; $ this -> error = null ; if ( $ this -> c2a ( ) ) { $ response = $ this -> template ( $ toObject ) ; } elseif ( $ this -> a2c ( ) ) { $ response = $ this -> template ( $ toObject ) ; } elseif ( $ this -> i2c ( ) ) { $ response = $ this -> template ( $ toObject ) ; } elseif ( $ this -> p2c ( ) ) { $ response = $ this -> template ( $ toObject ) ; } if ( $ response ) { $ this -> reset ( ) ; return $ response ; } throw new Exception ( trans ( 'location::errors.not_enough_data' ) ) ; }
Return the results
Return the results