LaravelPackages.net
Acme Inc.
Toggle sidebar
irius-digital/last-login-activity

Package to get last login activity

6
2
1.0.0
About irius-digital/last-login-activity

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 to get and logged last login activity/activities

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.

Comments