xt / laravel-login-history
store login history of user
v1.0.4
2022-11-07 12:48 UTC
Requires
- php: ^7.4|^8.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
README
Store login history of user (ip, region, country, user agent).
Installation
You can install the package via composer:
composer require xt/laravel-login-history
Run Migrations
Publish the migrations with this artisan command:
php artisan vendor:publish --tag=laravel-login-history-migrations
Configuration
You can publish the config file with this artisan command:
php artisan vendor:publish --tag=laravel-login-history-config
Usage
use Xt\LoginHistory\Traits\HasLoginHistory; class User extends Model { use HasLoginHistory; }
After successful login
Call following function after user login successfully
use \Illuminate\Support\Facades\Auth; Auth::user()->addLoginHistory();
IpInfo API token
get api token from ipinfo.io and add it to your .env file
IPINFO_API_TOKEN=xxxxxx
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email hiren.reshamwala@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.