In this laravel tutorial, I will tell you how to get an IP address from a request in Laravel.
Sometime we may require to get the client IP address from request object in our laravel application. In core PHP you can get from $_SERVER, but Laravel framework provides a very simple easy way to get client IP address from request.
Here, bellow I gave you an example of how you can get an IP address from a request. you can achieve this in Laravel by using request facade and helper:
$clientIP = \Request::ip();
$clientIP = \Request::getClientIp(true);
$clientIP = request()->ip();
public function ipaddress(Request $request)