## What Adds two timestamp columns to `users`: - **`last_logged_in_at`** — set by an `UpdateLastLoggedInAt` listener on Laravel's `Login` event. Records each explicit authentication (login form or remember-me re-auth). Does **not** update on plain session-based requests. - **`last_active_at`** — set by a `TrackLastActiveAt` middleware on authenticated web requests. Records the last moment the user did anything. Throttled to at most one write per 5 minutes to avoid a DB write on every request. ## Why `last_logged_in_at` answers "when did they last authenticate"; `last_active_at` answers "when were they last using the app" (any screen/activity), which a session-based login does not capture. ## Tests - Login records `last_logged_in_at` - Authenticated request records `last_active_at` - Throttle window respected (no rewrite within 5 min) and refreshed once it passes Migrations not yet run on environments. |
||
|---|---|---|
| .. | ||
| factories | ||
| migrations | ||
| seeders | ||
| .gitignore | ||