Laravel get ip address

Example 1:

$clientIP = \Request::ip();

Example 2:

$clientIP = \Request::getClientIp(true);

Example 3:

$clientIP = request()->ip();

Example 4:

public function index(Request $request)
{
 dd($request->ip());
}