New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

xetaio/xetaravel-iptraceable

A simple package that update an IP field when the user login into the application.
4,846
Install
composer require xetaio/xetaravel-iptraceable
Latest Version:13.0.0
PHP:^8.3
Laravel:13
Older releases:5 · 7 – 12
License:MIT
Last Updated:Apr 24, 2026
Links: GitHub  ·  Packagist
Maintainer: Xety

Xetaravel IpTraceable

Latest Stable Version Total Downloads Tests Laravel 13+ License

A simple Laravel package that tracks the IP address of a user on login. Also handles the remember_me token via middleware.

Requirements

  • PHP >= 8.3
  • Laravel >= 13.0

Installation

composer require xetaio/xetaravel-iptraceable

Service Provider

Laravel auto-discovers the service provider. If you have disabled auto-discovery, register it manually in bootstrap/providers.php:

return [
    // ...
    Xetaio\IpTraceable\Providers\IpTraceableServiceProvider::class,
];

Middleware (remember me support)

The package ships with an optional middleware that updates the IP on requests authenticated via a remember me token. Register it in bootstrap/app.php after StartSession:

->withMiddleware(function (Middleware $middleware) {
    $middleware->web(append: [
        \Xetaio\IpTraceable\Http\Middleware\IpTraceable::class,
    ]);
})

Note: The middleware must be registered after Illuminate\Session\Middleware\StartSession.

Configuration

Publish the config file:

php artisan vendor:publish --provider="Xetaio\IpTraceable\Providers\IpTraceableServiceProvider" --tag=config

Available options in config/iptraceable.php:

return [
    'fields' => [
        'last_login_ip' => 'last_login_ip',   // Column name for the IP address
        'last_login_date' => null,               // Set a column name to enable, or null to disable
    ],
];

Database

Add the required columns to your users table:

$table->ipAddress('last_login_ip')->nullable();
$table->dateTime('last_login_date')->nullable(); // Optional — enable in config

How it works

Trigger Mechanism
Standard login IpTraceableSubscriber listens to Illuminate\Auth\Events\Login and updates the IP automatically
Remember me token IpTraceable middleware checks viaRemember() on each request and updates the IP if needed

Testing

composer test

Contributing

Pull requests are welcome.

Related Packages

it2k/laravel-users

Модуль управления пользовательми для фрейморка laravel.

16 1
highideas/laravel-users-online

This package will provide an online users management.

125,463 197
alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support fo...

18,970 23
tlx3/laravel-jwt-starter

Boilerplate for using your own API based JWT authentication on Laravel applicati...

305 3
ax2to/laravel-user

Custom users package

15 0

Version History

Version Released PHP Laravel License
13.0.0 ^8.3 ^13.0 MIT
12.0.0 ^8.2 ^12.0 MIT
11.0.0 >=8.2 ^11.0 MIT
10.0.0 >=8.1 ^10.0 MIT
9.0.0 >=7.3 ^8.0 || ^9.0 MIT