How to get IP laravel 5.1 and print?

- 1 answer

Ad

I am working on Laravel 5.1 and do not know how to get the IP and print it. I know that in PHP using $_SERVER[“REMOTE_ADDR”].

I have tried this {!!Request::ip()!!} but nothing. Please help me

Ad

Answer

Ad

That's fine, ::1 is localhost on IPv6, Try 127.0.0.1:8000 to fix your issue if you want IPv4

Ad
source: stackoverflow.com
Ad