mardi 19 février 2019

Laravel giving error Undefined property: stdClass::$latitude

I am trying to use a package a link! and when after installation I tried to run this project it just failed and started giving me the error of Undefined Property. So if anyone could help me out.

namespace Voerro\Laravel\VisitorTracker\Geoip;

class Ipstack extends Driver
{
    protected function getEndpoint($ip)
    {
        $key = config('visitortracker.ipstack_key');

        return "http://api.ipstack.com/{$ip}?access_key={$key}";
    }

    public function latitude()
    {
        return $this->data->latitude;
    }

    public function longitude()
    {
        return $this->data->longitude;
    }

    public function country()
    {
        return $this->data->country_name;
    }

    public function countryCode()
    {
        return $this->data->country_code;
    }

    public function city()
    {
        return $this->data->city;
    }
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire