Projectslaravel-audit-logsAuth Events

Laravel Audit Logs

Package

Audit logging for Eloquent models and auth events in Laravel.

Auth Events

Authentication events are logged as audit type records by default. Listeners are registered from audit-logs.auth_events in config.

Default map

EventAction
Illuminate\Auth\Events\AttemptingLogin Attempt
Illuminate\Auth\Events\Authenticated(no log — preloads the user on the recorder)
Illuminate\Auth\Events\CurrentDeviceLogoutLogout (current device) successful
Illuminate\Auth\Events\FailedLogin failed
Illuminate\Auth\Events\LockoutRequest locked out
Illuminate\Auth\Events\LoginLogin successful
Illuminate\Auth\Events\OtherDeviceLogoutLogout (other device) successful
Illuminate\Auth\Events\PasswordResetPassword reset successful
Illuminate\Auth\Events\PasswordResetLinkSentPassword reset link sent
Illuminate\Auth\Events\RegisteredUser registered
Illuminate\Auth\Events\ValidatedLogin validation successful
Illuminate\Auth\Events\VerifiedEmail verification successful

Where applicable, payloads include the auth guard and the configured user_identifier attribute (default email).

Disabling or remapping

Set a listener to null or false to skip registration:

use Illuminate\Auth\Events\Attempting;
use Illuminate\Auth\Events\Login;

'auth_events' => [
    Attempting::class => false, // noisy; often disabled
    Login::class => App\Listeners\CustomLoginAudit::class,
    // …keep or omit other defaults as needed
],

Publish the config and copy the defaults you want to keep from vendor/bradietilley/laravel-audit-logs/config/audit-logs.php.

User caching note

The authorised user is cached on the recorder for the request. After logout you may still see the previous user on logs written in the same request — that is intentional so logout events remain attributable. Subsequent requests will not carry that user.

Next steps