PHPackages                             umii/login-alert - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. umii/login-alert

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

umii/login-alert
================

Send email/SMS alerts on user login with IP, device info, and auto location (zero-config).

v1.0.3(9mo ago)01MITPHPPHP &gt;=8.0

Since Aug 21Pushed 9mo agoCompare

[ Source](https://github.com/Umii010/umii-login-alert)[ Packagist](https://packagist.org/packages/umii/login-alert)[ RSS](/packages/umii-login-alert/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

🔐 Umii Login Alert
==================

[](#-umii-login-alert)

**Package:** `umii/login-alert`
Send an email (and optionally SMS) whenever a user logs in. Includes IP address, device info, user agent, and location (auto-resolved). Supports **new device/IP-only alerts**.

---

✨ Features
----------

[](#-features)

- 📩 Sends login alerts via **Laravel Notifications** (Mail/SMS supported)
- 🌍 Auto-detects **IP, device, user agent, location**
- 🆕 "Only new devices" mode with fingerprint storage
- ⚡ Plug &amp; play: **auto-discovered service provider**
- ⏳ Queueable notifications supported

---

📦 Installation
--------------

[](#-installation)

```
composer require umii/login-alert
php artisan vendor:publish --tag=config
php artisan vendor:publish --tag=migrations
php artisan migrate
```

---

⚙️ Setup
--------

[](#️-setup)

1. **Configure mail in `.env`** (required for email alerts):

    ```
    MAIL_MAILER=smtp
    MAIL_HOST=smtp.mailtrap.io
    MAIL_PORT=2525
    MAIL_USERNAME=your-username
    MAIL_PASSWORD=your-password
    MAIL_ENCRYPTION=tls
    MAIL_FROM_ADDRESS=no-reply@yourapp.com
    MAIL_FROM_NAME="${APP_NAME}"
    ```
2. **(Optional) Track new devices**
    Add the provided trait to your `User` model to enable *"only new device"* alerts:

    ```
    use Illuminate\Foundation\Auth\User as Authenticatable;
    use Illuminate\Notifications\Notifiable;
    use Umii\LoginAlert\Traits\TracksLoginAlerts;

    class User extends Authenticatable
    {
        use Notifiable, TracksLoginAlerts;
    }
    ```
3. **(Optional) SMS support**

    - Install Vonage/Nexmo or Twilio driver
    - Implement `routeNotificationForVonage()` or `routeNotificationForTwilio()` on your `User` model.

---

⚙️ Configuration
----------------

[](#️-configuration)

File: `config/login-alert.php`

```
return [
    // Send alerts only on new devices/IPs?
    'only_new_devices' => false,

    // Location resolver: default uses ip-api.com (free IP lookup)
    'location_resolver' => Umii\LoginAlert\Support\DefaultLocationResolver::class,
];
```

---

🧠 How It Works
--------------

[](#-how-it-works)

- Listens to `Illuminate\Auth\Events\Login`
- Extracts IP, User-Agent, device info
- Resolves location automatically via configured resolver
- Sends notification immediately (queued if your app uses queues)
- If `only_new_devices = true`, compares with stored fingerprints in `login_alerts` table

---

📨 Example Email
---------------

[](#-example-email)

```
Subject: 🔐 Login Alert - YourApp

Hello John Doe,

We noticed a new login to your account. Here are the details:

IP Address: 203.0.113.10
Location: Karachi, PK
Device: Windows - Chrome
User Agent: Mozilla/5.0 (...)

If this was you, no further action is required.
If this wasn’t you, please reset your password immediately and contact support.

Regards,
YourApp

```

---

🧩 Notes
-------

[](#-notes)

- Without the `TracksLoginAlerts` trait → every login triggers an alert.
- With the trait → alerts trigger only on new device/IP (depending on config).
- Supports Laravel’s native `ShouldQueue` for async notifications.

---

📝 License
---------

[](#-license)

MIT © Muhammad

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance58

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

270d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.0.2PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a63c961b7282bf04fc6c5ebdb5214753663dddf9c4ee0d24ac12c88db4f17dcd?d=identicon)[Umii010](/maintainers/Umii010)

---

Top Contributors

[![umer0010](https://avatars.githubusercontent.com/u/175431167?v=4)](https://github.com/umer0010 "umer0010 (7 commits)")

### Embed Badge

![Health badge](/badges/umii-login-alert/health.svg)

```
[![Health](https://phpackages.com/badges/umii-login-alert/health.svg)](https://phpackages.com/packages/umii-login-alert)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[olssonm/l5-very-basic-auth

Laravel stateless HTTP basic auth without the need for a database

1662.5M1](/packages/olssonm-l5-very-basic-auth)[stechstudio/laravel-jwt

Helper package that makes it easy to generate, consume, and protect routes with JWT tokens in Laravel

126117.6k](/packages/stechstudio-laravel-jwt)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
