PHPackages                             amir-hossein5/laravel-ip-logger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. amir-hossein5/laravel-ip-logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

amir-hossein5/laravel-ip-logger
===============================

v1.2.1(3y ago)08MITPHPPHP ^8.0

Since Feb 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/amirHossein5/laravel-ip-logger)[ Packagist](https://packagist.org/packages/amir-hossein5/laravel-ip-logger)[ RSS](/packages/amir-hossein5-laravel-ip-logger/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (5)Used By (0)

Mixes getting details of ip and saving it.

Prerequisites
-------------

[](#prerequisites)

- Laravel `^8.0|^9.0`
- PHP 8
- guzzlehttp/guzzle: `^6.3.1|^7.0.1`

Installation
------------

[](#installation)

```
composer require amir-hossein5/laravel-ip-logger
```

and for publishing configuration file:

```
php artisan vendor:publish --tag ipLogger
```

Usage
-----

[](#usage)

For just getting details:

```
use AmirHossein5\LaravelIpLogger\Facades\IpLogger;

IpLogger::getDetails();
```

Methods for work with details:

methoddescriptiondetailsBe()[Writing details manually](#manually-getting-details).prepare()Editting predefined details.*for Example:*

```
use AmirHossein5\LaravelIpLogger\Facades\IpLogger;

IpLogger::prepare(function ($details) {
  return $details + ['test' => 'test'];
})->getDetails();
```

Saving to database
------------------

[](#saving-to-database)

```
use AmirHossein5\LaravelIpLogger\Facades\IpLogger;

IpLogger::model(ModelName::class)
  ->updateOrCreate(
    fn ($details) => [
      'ip'        => $details['query']
    ],
    fn ($details) => [
      'continent' =>  $details['continent'],
      'country'   =>  $details['country'],
      ...
    ],
);
```

For saving there are two methods, `create`, `updateOrCreate`, and work like laravel ones.

Manually getting details
------------------------

[](#manually-getting-details)

By default has been wroten two apis to getting details of ip, [ip\_api](https://ip-api.com/) ,and [vpn\_api](https://vpnapi.io/). It's settable in config file.

Or if you want to use another api get details manually.

```
use \AmirHossein5\LaravelIpLogger\Facades\IpLogger;

IpLogger::detailsBe(function () {
  return [ ... ];
})->updateOrCreate(...);
```

Exception Handling
------------------

[](#exception-handling)

Except exceptions that when saving to database(e.g, create, updateOrCreate) happens, can be handle by using:

### Getting Last Exception That Happened

[](#getting-last-exception-that-happened)

```
use AmirHossein5\LaravelIpLogger\Facades\IpLogger;

IpLogger::getLastException();
```

### Catching Exceptions Inline

[](#catching-exceptions-inline)

```
use AmirHossein5\LaravelIpLogger\Facades\IpLogger;

IpLogger::catch(function ($exception) {
  // send mail ...
})...;
```

> You should use this as the first method.

> When using this way no event will be dispatch.

### Listening For Exceptions

[](#listening-for-exceptions)

```
/**
 * The event listener mappings for the application.
 *
 * @var array
 */
protected $listen = [
  AmirHossein5\LaravelIpLogger\Events\Failed::class => [
    IpLoggerFailed::class,
  ]
];
```

License
-------

[](#license)

[License](LICENSE)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~48 days

Total

4

Last Release

1410d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8965321404f59b9bc2b2ec90f25cc2dd341030cb6863de0d4721a12b239ae079?d=identicon)[amirHossein5](/maintainers/amirHossein5)

---

Top Contributors

[![amirHossein5](https://avatars.githubusercontent.com/u/68776630?v=4)](https://github.com/amirHossein5 "amirHossein5 (27 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (2 commits)")

---

Tags

ip-loggerlaravelphp

### Embed Badge

![Health badge](/badges/amir-hossein5-laravel-ip-logger/health.svg)

```
[![Health](https://phpackages.com/badges/amir-hossein5-laravel-ip-logger/health.svg)](https://phpackages.com/packages/amir-hossein5-laravel-ip-logger)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14642.7k1](/packages/guanguans-laravel-exception-notify)[hosmelq/laravel-logsnag

Integrate the power of LogSnag's real-time event tracking into your Laravel application.

237.9k](/packages/hosmelq-laravel-logsnag)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
