skyosev/login-activity-log

Track users login activity for Laravel 5.5+
1,650
Install
composer require skyosev/login-activity-log
Latest Version:1.0.3
PHP:>=7.2
License:MIT
Last Updated:Nov 30, 2020
Links: GitHub  ·  Packagist
Maintainer: stoyankyosev

Track user login activity in Laravel

This package will subscribe for login and logout events and will log data every time they are fired. The log target can be the database or the default Laravel log handler.

Requirements

Laravel Framework > 5.5

Installation

In terminal

composer require skyosev/login-activity-log

Publish migrations

php artisan vendor:publish --provider="Kiva\LoginActivity\LoginActivityServiceProvider" --tag="migrations"
php artisan migrate

Optionally publish config

php artisan vendor:publish --provider="Kiva\LoginActivity\LoginActivityServiceProvider" --tag="config"

Usage

Once installed, the package will begin to store logs automatically in the appropriate target (database by default). There is also a simple repository implementation with several methods for logs retrieval from database. You can use the Kiva\LoginActivity\Facades\LoginActivityRepository facade to access them:

Get latest logs

$logs = LoginActivityRepository::getLatestLogs(100); // number of logs to get (leave empty to use the config value)

Get latest login logs

$logs = LoginActivityRepository::getLatestLoginLogs(100); // number of logs to get (leave empty to use the config value)

Get latest logout logs

$logs = LoginActivityRepository::getLatestLogoutLogs(100); // number of logs to get (leave empty to use the config value)

Clean log

$logs = LoginActivityRepository::cleanLog(30); // Offset in days

Clean the log from terminal

php artisan login-activity:clean

Credits

License

MIT - http://opensource.org/licenses/MIT

Related Packages

gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

631,580,251 9,707
laravel/framework

The Laravel Framework.

580,311,802 34,925