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(10mo ago)01MITPHPPHP &gt;=8.0

Since Aug 21Pushed 10mo 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 today

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

28

—

LowBetter than 52% of packages

Maintenance54

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

315d ago

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

v1.0.2PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/92120031?v=4)[Muhammad Umer Shahzad](/maintainers/Umii010)[@Umii010](https://github.com/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

[directorytree/ldaprecord-laravel

LDAP Authentication &amp; Management for Laravel.

5752.3M18](/packages/directorytree-ldaprecord-laravel)[illuminate/auth

The Illuminate Auth package.

10528.2M1.2k](/packages/illuminate-auth)[althinect/filament-spatie-roles-permissions

3481.1M10](/packages/althinect-filament-spatie-roles-permissions)[masterix21/laravel-licensing

Laravel licensing package with polymorphic assignment to any model, activation keys, expirations/renewals, and seat control via LicenseUsage. Supports offline verification with public-key–signed tokens, a CLI to generate/rotate/revoke keys, and an extensible architecture via config and contracts.

1563.0k4](/packages/masterix21-laravel-licensing)

PHPackages © 2026

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