I am new to website development.
I need to capture the client's IP address.
I checked similar question https://stackoverflow.com/questions/33268683/how-to-get-client-ip-address-in-laravel-5
but couldn't understand much.
I used request()->ip()
but it gave me google cloud's ip everytime as website is on it and 127.0.0.1 locally.
I want to get client's ip() who visits my website.
How to get it?
I used $myPublicIP = trim(shell_exec("dig +short myip.opendns.com @resolver1.opendns.com"));
which locally give me my public IP address. Will this work when I upload my code on google cloud
?
and also can someone tell me $myPublicIP = trim(shell_exec("dig +short myip.opendns.com @resolver1.opendns.com"));
how this command works?