rappasoft/laravel-authentication-log
Laravel Authentication Log tracks user logins and logouts with IP, browser, location, and device fingerprint, sends alerts for new devices and failed attempts, and adds session management plus suspicious activity detection.
composer require plus a trait and a migration. That is the core decision: spend engineering time on the differentiated product, not on table stakes security plumbing.RequireTrustedDevice middleware make a natural gate for a higher-tier plan (e.g., "enforce trusted devices for sensitive actions" for enterprise/team tiers) or as a differentiator in security-questionnaire-driven sales. Session revocation and export are commonly listed compliance asks in RFPs — knowing they're ~one sprint with this package changes pricing and positioning conversations.fromIp, recent, failed, forUser) supports audit-evidence and data-subject-access requests without a bespoke admin tool. It gives a defensible answer to "how do you detect and log unauthorized access?" in SOC 2 / ISO 27001 / security-review conversations — useful, though not sufficient on its own (see caveats below).login, failed, new_device, suspicious) means security events can be piped to Slack, PagerDuty, or an internal SIEM-lite without building an event bus first — a decision that can be made after adoption, not before.Good fit when:
Authenticatable user model, and conventional session-based auth. Version 13.x requires 6.1+; Laravel 10 and below should use 3.x, which lacks the modern feature set — don't adopt the new capabilities there.Look elsewhere when:
authentication_log table and scopes will need real design work, and that work is on you.Dependents: 0 reported) means the maintenance risk lands on your team. Stars are a weak proxy, but the absence of broad downstream usage is a signal to plan for self-sufficiency.Adoption guardrails to set before committing: pin the major version, verify the upgrade migration path (v3→v6 adds columns to an existing table — test on a production-like copy), decide retention and PII policy for IP/UA/location data up front, and confirm the notification channels (mail, Slack, SMS) your plan actually has configured. Rate limiting on notifications is configurable but must be tuned, or new-device emails become noise and users start ignoring them — which silently destroys the security value.
To executives (one paragraph): We can deliver the account-security features customers and security questionnaires keep asking for — login history, "new device" alerts, active-session visibility, remote logout, suspicious-login flagging, and audit export — in roughly one sprint instead of one or two quarters of custom work. It's MIT-licensed with no per-seat or subscription cost, so there's no vendor negotiation, no lock-in, and no incremental COGS. The trade-off is that it's a focused open-source component maintained by a small team, so we treat it as a dependency we own the risk on: we pin the version, keep the surface area thin (trait, migration, config), and accept that if upstream stalls we can fork it — the code footprint is small enough that this is a realistic fallback, not a bluff. Recommended decision: adopt now for the audit-log and device-visibility layers, defer the suspicious-activity heuristics and trusted-device enforcement until we've validated notification volume and false-positive rates with real users.
To engineering (the ask): One trait on the User model, one published migration, one config file, and optional route middleware. It provides the tables and query scopes so we mainly build UI and product logic on top. Key work items are ours, not theirs: retention/PII policy for stored IP and user-agent data, notification throttling tuning, deciding whether GeoIP is worth the third-party dependency, and an upgrade test against a snapshot of the production schema. Pin the major version and note the Laravel/PHP floor (11+/8.2+) in our dependency policy; if we're still on Laravel 10, this becomes a post-upgrade item and the modern features aren't available to us.
Honest limitations to state up front: it's detective, not preventive; suspicious-activity detection is rule-based heuristics, not risk scoring; it logs authentication events in our database, not a compliance-grade immutable ledger; and it is not a replacement for MFA, SSO, or a real security-monitoring stack. Positioned correctly — as the fastest credible path to a user-facing security and session-management surface — the value case is strong and the risk is contained.
How can I help you explore Laravel packages today?