Skip to main content
Every stage of the authentication lifecycle dispatches events you can listen to for auditing, SIEM attribution, side effects, and real-time monitoring. The package fires Laravel’s standard auth events so your existing listeners keep working, and adds custom events for the contextual concepts — principal assignment, device binding, and refresh rotation — that Laravel’s built-in events do not cover.

Standard Laravel events

These events are dispatched on both the JWT bearer and HTTP Basic paths:

Custom events

PrincipalAssigned

Dispatched immediately after the principal resolver binds a principal to a guard. Carries the guard name and the resolved principal instance.

DeviceAuthenticated

Dispatched when a device is hydrated from the devices table and bound to the guard during a bearer or refresh request. Carries the guard name and the device instance. Listeners on this event may persist request metadata — such as last IP address or user-agent — during the authentication lifecycle.

Refreshed

Dispatched after a successful refresh-token exchange. Implements ShouldDispatchAfterCommit, so it fires only after the rotation database transaction commits. Carries the full contextual surface so activity-log consumers can attribute the refresh without a second round-trip through the guard.

RefreshFailed

Dispatched whenever a refresh-token exchange fails. Carries a RefreshFailureReason backed enum so SIEM consumers can count and alert on failure modes without scraping log messages.

RefreshFailureReason reason codes

RefreshFailed carries a RefreshFailureReason backed enum. Every failure path dispatches a distinct reason code so you can attribute events without ambiguity:

Listening to events

Register listeners in your EventServiceProvider or using Laravel’s #[AsEventListener] attribute:
Or using the attribute syntax available in Laravel 11+: