villaflor/laravel-ip-address

A Laravel library for retrieving accurate public IP address of the server.

Installs: 58

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/villaflor/laravel-ip-address

1.0.3 2021-02-20 17:53 UTC

This package is auto-updated.

Last update: 2025-09-21 03:56:36 UTC


README

A light and simple library to obtain the server's public IP Address. This library is useful in updating your DNS target server IP Address if you are using a dynamic IP Address in hosting your server.

Installation

composer require villaflor/laravel-ip-address

Usage

It is very easy to use this library. Here is an example of printing the public IP Address of a server.

use Villaflor\IpAddress\IpAddress;

public function printPublicIpAddress(): void
{
    $publicIp = IpAddress::getPublicIp();
    
    echo $publicIp;
}