I am working on a real estate site. I need to show properties of a specific city only on the home page. How can I check the ip of the visitor and check the city from where he is visiting ?
You can get user ip with:
$request->ip()
Then you need to send request to api that give you a location of an ip, some of these services are:
you can use : request()->ip();
or
you can also use \Request::ip();
Thanks everybody. Will try these options.
You can get user ip with:
Then you need to send request to api that give you a location of an ip, some of these services are: