public function get($ip)
    {
        $data = $this->getRaw($ip);

        if (empty($data) || (array_get($data, 'status') === 'fail')) {
            return $this->getDefault();
        }

        return [
            'city' => array_get($data, 'city'),
            'country' => array_get($data, 'country'),
            'countryCode' => array_get($data, 'countryCode'),
            'latitude' => (float) number_format(array_get($data, 'lat'), 5),
            'longitude' => (float) number_format(array_get($data, 'lon'), 5),
            'region' => array_get($data, 'regionName'),
            'regionCode' => array_get($data, 'region'),
            'timezone' => array_get($data, 'timezone'),
            'postalCode' => array_get($data, 'zip'),
        ];
    }
public function get($ip)
    {
        $data = $this->getRaw($ip);

        if (empty($data) || (array_get($data, 'status') === 'fail')) {
            return $this->getDefault();
        }

        return [
            'city' => array_get($data, 'city'),
            'country' => array_get($data, 'country'),
            'countryCode' => array_get($data, 'countryCode'),
            'latitude' => (float) number_format(array_get($data, 'lat'), 5),
            'longitude' => (float) number_format(array_get($data, 'lon'), 5),
            'region' => array_get($data, 'regionName'),
            'regionCode' => array_get($data, 'region'),
            'timezone' => array_get($data, 'timezone'),
            'postalCode' => array_get($data, 'zip'),
        ];
    }
public function get ( $ ip ) { $ data = $ this -> getRaw ( $ ip ) ; if ( empty ( $ data ) || ( array_get ( $ data , 'status' ) === 'fail' ) ) { return $ this -> getDefault ( ) ; } return [ 'city' => array_get ( $ data , 'city' ) , 'country' => array_get ( $ data , 'country' ) , 'countryCode' => array_get ( $ data , 'countryCode' ) , 'latitude' => ( float ) number_format ( array_get ( $ data , 'lat' ) , 5 ) , 'longitude' => ( float ) number_format ( array_get ( $ data , 'lon' ) , 5 ) , 'region' => array_get ( $ data , 'regionName' ) , 'regionCode' => array_get ( $ data , 'region' ) , 'timezone' => array_get ( $ data , 'timezone' ) , 'postalCode' => array_get ( $ data , 'zip' ) , ] ; }
Get array of data using ip-api.

@param string $ip

@return array
Get array of data using ip - api .