Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use method non-object #9

Closed
theavuthnh opened this issue Jun 11, 2014 · 5 comments
Closed

use method non-object #9

theavuthnh opened this issue Jun 11, 2014 · 5 comments
Labels

Comments

@theavuthnh
Copy link

I try to show my current city, but I got an error with "Trying to get property of non-object".
any answer?
Thanks!

@antonioribeiro
Copy link
Owner

How did you do that?

@theavuthnh
Copy link
Author

I was composed it to my laravel project and migrated db already, then I try to use some method like
$visitor = Tracker::currentSession();
var_dump( $visitor->geoIp->city);

but I get an error "non-object"

@antonioribeiro
Copy link
Owner

You have to understand that if you are in a local network and your IP address is in ranges like 192.168., 10. or 172.*, it may not get your geoip, so you have to check it by:

if ($visitor->geoIp) var_dump( $visitor->geoIp->city);

@theavuthnh
Copy link
Author

OK,
I will tomorrow now at Cambodia midnight.
Thanks for your support!

@antonioribeiro
Copy link
Owner

You're welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants