Comments (5)
But in the docs you do "$ip_address = '216.239.36.21';", i need to get that ip from the client request
from laravel.
@marcemarin If you want your public IP, this is the wrong package - use the PHP package at https://github.com/ipinfo/php.
This package is meant to retrieve details automatically for the client IP of the request. It will not make requests for any random IP you wish, which is what the underlying PHP package is for.
In this case the "client IP" was "172.18.0.1". If an outside user had the IP "1.2.3.4" and hit your Laravel endpoint, you'd see that IP instead.
from laravel.
172.18.0.1 is a bogon - it isn't the client IP (assuming the request was made over the public internet). @marcemarin do you have a loadbalancer or something? Or are you making requests to a dev server over a local network or something?
from laravel.
Thanks a lot guys, it works perfect
from laravel.
It's definitely a matter of making requests to a dev server over the local network.
@marcemarin To elaborate a bit more, you need to use the PHP package and input the IP you want to look up within your request handler. This Laravel package is a simple wrapper over the PHP package and is dedicated to one thing: automating the lookup of the client IP.
from laravel.
Related Issues (14)
- Error HOT 3
- Laravel 6 support HOT 2
- Use versioned cache key HOT 1
- Handling exceptions HOT 1
- count(): Parameter must be an array or an object that implements Countable HOT 1
- Support for laravel 9? HOT 8
- Laravel 9 compatibility HOT 2
- Laravel 10 Support? HOT 2
- Does not support Laravel v 6.x HOT 2
- Get ip of the user HOT 4
- Laravel 11 compatibility
- Laravel 7 support HOT 2
- Add optional IP selection handler HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel.