Skip to content

Settings And IP Resolution

Login Audit wraps rappasoft/laravel-authentication-log, stores Capell-owned audit rows, adds settings, and registers a frontend activity middleware alias.

SurfaceCode
ModelCapell\LoginAudit\Models\LoginAudit
ObserverLoginAuditObserver on the vendor authentication log model
Middleware aliasfrontend.activity
Settings grouplogin_audit
Protected tablelogin-audit.table_name, default login_audit
Admin bridgeLoginAuditAdminBridge
User schema extenderLoginAuditUserSchemaExtender
KeyUse
login-audit.table_nameAudit table name.
login-audit.db_connectionOptional database connection for audit rows.
login-audit.eventsAuth events the package listens to.
login-audit.listenersListener classes for those events.
login-audit.notifications.new-device.enabledSends new-device notifications.
login-audit.notifications.failed-login.enabledSends failed-login notifications.
login-audit.purgeRetention window used by cleanup.
login-audit.behind_cdnCDN IP header config, or false.

ResolveLoginAuditIpAddressAction returns null when IP tracking is disabled by settings. When login-audit.behind_cdn is configured, it reads the configured server header instead of Request::ip().

config/login-audit.php
'behind_cdn' => [
'http_header_field' => 'HTTP_CF_CONNECTING_IP',
],

Only set this when the application is actually behind a trusted CDN or proxy. A spoofable header is worse than no IP logging.

Terminal window
vendor/bin/pest packages/login-audit/tests --configuration=phpunit.xml