0

I am using Laravel package for getting location using IP Address.

composer require ipinfo/ipinfolaravel

But when I hit request to get data of location it return null for local host. I have use this,

public function index(Request $request)
{
    dd($request->ipinfo->all);
}

and get out put as,

array:5 [▼
    "ip" => "127.0.0.1"
    "bogon" => true
    "country_name" => null
    "latitude" => null
    "longitude" => null
]

and if I use code like this

public function index(Request $request)
{
    dd($request->ipinfo->country_name);
}

it return

null

How can i solve this issue?

Irshad Khan
  • 161
  • 2
  • 15

0 Answers0