Store login history of user (ip, region, country, user agent).
You can install the package via composer:
composer require xt/laravel-login-history
Publish the migrations with this artisan command:
php artisan vendor:publish --tag=laravel-login-history-migrations
You can publish the config file with this artisan command:
php artisan vendor:publish --tag=laravel-login-history-config
use Xt\LoginHistory\Traits\HasLoginHistory;
class User extends Model
{
use HasLoginHistory;
}
Call following function after user login successfully
use \Illuminate\Support\Facades\Auth;
Auth::user()->addLoginHistory();
get api token from ipinfo.io and add it to your .env file
IPINFO_API_TOKEN=xxxxxx
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email hiren.reshamwala@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.