devworkout / laravel-user-ips
dev-master
2023-02-03 20:24 UTC
Requires (Dev)
This package is auto-updated.
Last update: 2025-03-01 00:20:57 UTC
README
Remember and track IPs of Laravel users.
Installation
You can install the package via composer:
composer require devworkout/laravel-user-ips
Usage
Add a HasIPs trait to your User model:
use \DevWorkout\UserIps\HasIPs;
Associate IP with user:
$user->rememberIP('127.0.0.1');
Get a list of associated IPs:
$ips = $user->ips()->pluck('ip');
Find IPs used by multiple users:
$ips = UserIP::withMultipleUsers()->get();
Find users using this IP:
$users = $ip->users();
Automatic IP recording
Automatic IP recording is enabled on login.
Testing
composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email us instead of using the issue tracker.
Credits
Support us
Give us a star!
License
The MIT License (MIT). Please see License File for more information.