you could try to have a look at that -> https://stackoverflow.com/questions/33268683/how-to-get-client-ip-address-in-laravel-5-1#41769505
Jul 28, 2018
11
Level 4
$request->ip() returns 127.0.0.1
I am on laravel 5.6 and I am using Cloudways free 3 day trail to test my app. The thing is my code returns 127.0.0.1 but not the real client IP Address. Here is my controller:
$article->ip = $request->ip();
This returns 127.0.0.1 every time even though it is on a live server.
I also tried:
$article->ip = $request->getClientIp();
Which is basically the same as above. Can't think of anyway why this wouldn't work.
Please or to participate in this conversation.