I am trying to get the client\'s IP address in Laravel.
It is easy to get a client\'s IP in PHP by using $_SERVER[\"REMOTE_ADDR\"]. It is working fine
Use request()->ip().
From what I understand, since Laravel 5 it's advised/good practice to use the global functions like:
response()->json($v);
view('path.to.blade');
redirect();
route();
cookie();
And, if anything, when using the functions instead of the static notation my IDE doesn't light up like a Christmas tree.