models/Address.php
public static function getIPLocation(){
        //initialize the browser
        $adapter = new GuzzleHttpAdapter();
        
        //create geocoder
        $geocoder = new \Geocoder\Provider\FreeGeoIp($adapter);

        if (!isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
          $client_ip = $_SERVER['REMOTE_ADDR'];
        }
        else {
          $client_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
        }

        return $geocoder->geocode($client_ip);
    }
public static function getIPLocation(){
        //initialize the browser
        $adapter = new GuzzleHttpAdapter();
        
        //create geocoder
        $geocoder = new \Geocoder\Provider\FreeGeoIp($adapter);

        if (!isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
          $client_ip = $_SERVER['REMOTE_ADDR'];
        }
        else {
          $client_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
        }

        return $geocoder->geocode($client_ip);
    }
public static function getIPLocation ( ) { //initialize the browser $ adapter = new GuzzleHttpAdapter ( ) ; //create geocoder $ geocoder = new \ Geocoder \ Provider \ FreeGeoIp ( $ adapter ) ; if ( ! isset ( $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ) ) { $ client_ip = $ _SERVER [ 'REMOTE_ADDR' ] ; } else { $ client_ip = $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ; } return $ geocoder -> geocode ( $ client_ip ) ; }
find the use location based upon his current IP address
@return mixed [description]
find the use location based upon his current IP address