1. Go to this page and download the library: Download iresis/login-audit library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Iresis\LoginAudit\Concerns\HasLoginAudit;
class User extends Authenticatable
{
use HasLoginAudit;
}
$user->loginAudits; // all recorded login/logout/failed events for this user
$user->auditSessions; // all recorded sessions
$user->activeAuditSessions; // sessions that haven't been logged out
$user->auditDevices(); // sessions grouped by device (browser/platform/device type)