irius-digital / last-login-activity
Package to get last login activity
1.0.0
2022-04-10 18:15 UTC
Requires
- php: ^8.0
- illuminate/contracts: ^9.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^6.0
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-11-09 10:28:48 UTC
README
Simple package to get and logged last login activity/activities
Simple package where you can save user login activity (my first time to create a package) apologies.
Installation
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), ], ];
Usage
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
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.