irius-digital/last-login-activity is a Laravel package for package to get last login activity.
It currently has 2 GitHub stars and 6 downloads on Packagist (latest version 1.0.0).
Install it with composer require irius-digital/last-login-activity.
Discover more Laravel packages by irius-digital
or browse all Laravel packages to compare alternatives.
Last updated
Simple package where you can save user login activity (my first time to create a package) apologies.
You can install the package via composer:
composer require irius-digital/last-login-activity
You can publish and run the migrations with:
php artisan vendor:publish --tag="last-login-activity-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="last-login-activity-config"
This is the contents of the published config file:
return [
'save_last_login' => [
'enabled' => env('SAVE_LAST_LOGIN', true),
],
];
Add this to your EventServiceProvider.php
use Illuminate\Auth\Events\Login;
use IriusDigital\LastLoginActivity\Events\LastActivityEvent;
protected $listen = [
Login::class => [
LastActivityEvent::class,
],
];
Add to your user model
use IriusDigital\LastLoginActivity\Traits\LoginActivities;
class User extends Authenticatable
{
...
use LoginActivities;
Then you can access your user model with
$user->latestLoggedIp
$user->loginActivities
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.