App\Http\Controllers\ExampleController::getGeolocation PHP Method

getGeolocation() public method

public getGeolocation ( )
    public function getGeolocation()
    {
        $data = ['homeMobileCountryCode' => 310, 'homeMobileNetworkCode' => 260, 'radioType' => "gsm", 'carrier' => "T-Mobile", 'cellTowers' => ['cellId' => 39627456, 'locationAreaCode' => 40495, 'mobileCountryCode' => 310, 'mobileNetworkCode' => 260, 'age' => 0, 'signalStrength' => -95], 'wifiAccessPoints' => [['macAddress' => "01:23:45:67:89:AB", 'signalStrength' => 8, 'age' => 0, 'channel' => 8, 'signalToNoiseRatio' => -65], ['macAddress' => "01:23:45:67:89:AC", 'signalStrength' => 4, 'age' => 0]]];
        $d['a'] = \GoogleMaps::load('geolocate')->setParam($data)->get();
        $d['b'] = \GoogleMaps::load('geolocate')->setParamByKey('homeMobileCountryCode', 310)->setParamByKey('homeMobileNetworkCode', 260)->setParamByKey('radioType', 'gsm')->setParamByKey('carrier', 'T-Mobile')->setParamByKey('cellTowers', ['cellId' => 39627456])->setParamByKey('cellTowers', ['locationAreaCode' => 40495])->setParamByKey('cellTowers', ['mobileCountryCode' => 310])->setParamByKey('cellTowers', ['mobileNetworkCode' => 260])->setParamByKey('cellTowers', ['age' => 0])->setParamByKey('wifiAccessPoints', ['macAddress' => '01:23:45:67:89:AB'])->setParamByKey('wifiAccessPoints', ['signalStrength' => 8])->setParamByKey('wifiAccessPoints', ['age' => 0])->setParamByKey('wifiAccessPoints', ['channel' => 8])->setParamByKey('wifiAccessPoints', ['signalToNoiseRatio' => -65])->setParamByKey('wifiAccessPoints', ['macAddress' => '01:23:45:67:89:AC'])->setParamByKey('wifiAccessPoints', ['signalStrength' => 4])->setParamByKey('wifiAccessPoints', ['age' => 0])->getResponseByKey('location');
        dd($d);
    }