【问题标题】:Laravel stevebauman/location returning wrong dataLaravel stevebauman/location 返回错误数据
【发布时间】:2015-04-09 04:34:11
【问题描述】:

使用:

我正在使用上述详细信息在本地开发应用程序,但使用该包时,我返回的数据不正确。

我用两种方法对此进行了测试,第一种是自动 ip 检测例如:Location::get();,第二种是手动输入我的 ip 例如:Location::get(' 192.168.1.1');

每次我得到相同的数据时:

object(Stevebauman\Location\Objects\Location)[141]
  public 'countryName' => string 'United States' (length=13)
  public 'countryCode' => string 'US' (length=2)
  public 'regionCode' => string 'CA' (length=2)
  public 'regionName' => string 'California' (length=10)
  public 'cityName' => string 'Mountain View' (length=13)
  public 'zipCode' => string '' (length=0)
  public 'isoCode' => string '' (length=0)
  public 'postalCode' => string '94043' (length=5)
  public 'latitude' => float 37.4192
  public 'longitude' => float -122.0574
  public 'metroCode' => string '' (length=0)
  public 'areaCode' => string '' (length=0)
  public 'isp' => string 'Google Inc.' (length=11)
  public 'ip' => string '66.102.0.0' (length=10)
  public 'driver' => string 'Stevebauman\Location\Drivers\Telize' (length=35)
  public 'error' => boolean false

有什么想法吗?

【问题讨论】:

  • 记住我来自英国而不是“美国”
  • 嗨,我是 location 包的开发者。我很高兴你已经解决了你的问题!如果您遇到更多问题,请在 git 存储库中创建问题:github.com/stevebauman/location/issues

标签: laravel location package geoip


【解决方案1】:

我已经想通了。包配置文件中有一个 localhost_testing 变量需要设置为 false

【讨论】:

  • 更新为:'testing' => [ 'enabled' => true, 'ip' => '66.102.0.0', ],
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-02-22
  • 2017-03-01
  • 2020-02-20
  • 2015-09-03
  • 1970-01-01
  • 2018-11-26
  • 2016-09-02
相关资源
最近更新 更多