protected function getData()
    {
        $ip = $this->getIp();
        $this->setIp($ip);

        // check ip in memory
        $data = array_get($this->store, $ip);

        if (! $data) {
            try {
                $data = $this->getDriver()->get($ip);
            } catch (\Exception $e) {
                throw new GeoIPException('Failed to get geoip data', 0, $e);
            }

            // cache ip data in memory
            $this->store[$ip] = $data;
        }

        return $data;
    }
protected function getData()
    {
        $ip = $this->getIp();
        $this->setIp($ip);

        // check ip in memory
        $data = array_get($this->store, $ip);

        if (! $data) {
            try {
                $data = $this->getDriver()->get($ip);
            } catch (\Exception $e) {
                throw new GeoIPException('Failed to get geoip data', 0, $e);
            }

            // cache ip data in memory
            $this->store[$ip] = $data;
        }

        return $data;
    }
protected function getData ( ) { $ ip = $ this -> getIp ( ) ; $ this -> setIp ( $ ip ) ; // check ip in memory $ data = array_get ( $ this -> store , $ ip ) ; if ( ! $ data ) { try { $ data = $ this -> getDriver ( ) -> get ( $ ip ) ; } catch ( \ Exception $ e ) { throw new GeoIPException ( 'Failed to get geoip data' , 0 , $ e ) ; } // cache ip data in memory $ this -> store [ $ ip ] = $ data ; } return $ data ; }
Get an array or single item of geoip data.

@throws \PulkitJalan\GeoIP\Exceptions\GeoIPException

@return array
Get an array or single item of geoip data .