Skip to content
Free since 2014. Built for the engineers who keep things running.

cat /articles/detecting-suspicious-logins-in-your-laravel-app.md

Laravel

★ Detecting suspicious logins in your Laravel app

A Laravel package that scores login attempts using signals like new devices, countries and failed attempts, then emails users or blocks logins based on configurable risk levels.

freek.dev20 Nov 2026 · 5 min read · summary

article --summary

The summary

This piece introduces laravel-suspicious-login, a Laravel package that flags unusual logins by combining several signals rather than relying on one, such as an unfamiliar device, a new country or repeated failed attempts. Each check adds points to a score, and configurable thresholds decide whether a login is medium or high risk. The author walks through a sample preset class that emails users for a new country and blocks logins when a new device and new country are both flagged. It also explains that the checks compare against earlier successful logins, so a first login is never flagged, and that the author recommends monitoring before enabling blocking because travel and VPNs can cause false positives. The article then covers using different presets for different users, such as admins, customizing the alert email with a subclassed mailable, and listening for the detection event to log suspicious attempts.

Editorial note: This is a summary of an article first published by freek.dev. The full piece is on their site.

Reading now

Topic
Laravel
Source
freek.dev
Published
20 Nov 2026
Format
Curated summary

Have a take on this?

Write it up and submit it. It goes on the list once an editor approves it.

Submit an article

articles --latest

Latest articles

New from the blogs we follow and the community.

All articles

newsletter --weekly

LaraChat Weekly, minus the noise.

The best reads, new jobs and upcoming events, in one email a week.