PHPackages                             areia-lab/laravel-login-notifier - 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. [Security](/categories/security)
4. /
5. areia-lab/laravel-login-notifier

ActiveLibrary[Security](/categories/security)

areia-lab/laravel-login-notifier
================================

Laravel package to notify users of logins from new devices or IP addresses for enhanced security.

v1.0.1(8mo ago)01MITPHPPHP ^8.0

Since Sep 15Pushed 8mo agoCompare

[ Source](https://github.com/areia-lab/laravel-login-notifier)[ Packagist](https://packagist.org/packages/areia-lab/laravel-login-notifier)[ RSS](/packages/areia-lab-laravel-login-notifier/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (4)Used By (0)

Laravel Login Notifier
======================

[](#laravel-login-notifier)

**Package:** `areia-lab/laravel-login-notifier`

A Laravel package to **monitor user logins**, detect **new devices or IP addresses**, log device and location information, and **notify users and admins** of suspicious or new login activity.

---

Features
--------

[](#features)

- Detect logins from **new devices or IP addresses**.
- Send **email notifications to users** on new logins.
- Send **alerts to admin** for every login.
- Log **device, browser, platform, IP, and geo-location**.
- Fully **configurable via a config file**.
- Supports **queueable notifications** for production.

---

Requirements
------------

[](#requirements)

This package requires the following:

- **PHP** `^8.1`
- **Laravel** `^10.0`
- **jenssegers/agent** `^2.6` – device &amp; browser detection
- **stevebauman/location** `^7.0` – IP geolocation lookup

---

Installation
------------

[](#installation)

```
composer require areia-lab/laravel-login-notifier
```

Publish the configuration and migration files:

```
php artisan vendor:publish --tag=login-notifier-config
php artisan vendor:publish --tag=login-notifier-migrations

php artisan migrate
```

> The migrations will create the `login_histories` table to store login data.

---

Configuration
-------------

[](#configuration)

Edit the published config file `config/login-notifier.php`:

```
return [
    'notify_user' => env('LOGIN_NOTIFIER_NOTIFY_USER', true),

    // Email address to receive admin notifications
    'notify_admin' => env('LOGIN_NOTIFIER_NOTIFY_ADMIN', true),
    'admin_email' => env('LOGIN_NOTIFIER_ADMIN_EMAIL', 'admin@example.com'),

    'secure_url' => env('LOGIN_NOTIFIER_SECURE_URL', 'forgot-password'),
];
```

---

Usage
-----

[](#usage)

This package works **automatically** on every login. You don’t need to call anything manually.

```
use Illuminate\Support\Facades\Auth;

Auth::attempt(['email' => 'user@example.com', 'password' => 'password']);
```

The following happens automatically:

1. Login is recorded in `login_histories`.
2. New device/IP detection is performed.
3. User notification is sent if enabled.
4. Admin notification is sent if enabled.

---

Access Login Histories (Facade)
-------------------------------

[](#access-login-histories-facade)

The package provides a **facade** for querying login histories:

```
use AreiaLab\LoginNotifier\Facades\LoginHistory;

// Get all login histories
$all = LoginHistory::getAllHistories();

// Get recent 10 logins
$recent = LoginHistory::getRecentHistories(10);

// Get all logins for a specific user
$userLogins = LoginHistory::getUserHistories($userId);

// Get last login of a user
$lastLogin = LoginHistory::getLastLoginForUser($userId);

// Get logins from new devices for a user
$newDeviceLogins = LoginHistory::getNewDeviceLoginsForUser($userId);
```

---

Notifications
-------------

[](#notifications)

### UserLoginAlert

[](#userloginalert)

- Sent to users on login from a **new device or IP**.
- Includes: **IP, device, browser, platform, location, timestamp**.
- Includes a **call-to-action button** to secure the account.

### AdminLoginAlert

[](#adminloginalert)

- Sent to admin on every login.
- Includes user login details: **IP, device, browser, location, timestamp**.
- Provides a **link to review user activity** in the admin dashboard.

---

Contributing
------------

[](#contributing)

Contributions, issues, and feature requests are welcome!

1. Fork the repo.
2. Create a feature branch.
3. Submit a Pull Request.

---

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance62

Regular maintenance activity

Popularity1

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.8% 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

2

Last Release

240d ago

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

v1.0.1PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d954a36b146e87dd3f3c8e05e2e174daec70883c5ada3ad2f572016fcea3fc3?d=identicon)[areiatech](/maintainers/areiatech)

---

Top Contributors

[![engr-akramulhoque](https://avatars.githubusercontent.com/u/116001734?v=4)](https://github.com/engr-akramulhoque "engr-akramulhoque (7 commits)")[![areiatech](https://avatars.githubusercontent.com/u/142617586?v=4)](https://github.com/areiatech "areiatech (2 commits)")

---

Tags

laravelsecuritynotifier2faloginuser authenticationDevice detectionip-detectionlogin-notificationaccount-protection

### Embed Badge

![Health badge](/badges/areia-lab-laravel-login-notifier/health.svg)

```
[![Health](https://phpackages.com/badges/areia-lab-laravel-login-notifier/health.svg)](https://phpackages.com/packages/areia-lab-laravel-login-notifier)
```

###  Alternatives

[tzsk/otp

A secure, database-free One-Time Password (OTP) generator and verifier for PHP and Laravel.

241641.4k1](/packages/tzsk-otp)[akaunting/laravel-firewall

Web Application Firewall (WAF) package for Laravel

999465.8k2](/packages/akaunting-laravel-firewall)[dgtlss/warden

A Laravel package that proactively monitors your dependencies for security vulnerabilities by running automated composer audits and sending notifications via webhooks and email

8745.6k](/packages/dgtlss-warden)[ercsctt/laravel-file-encryption

Secure file encryption and decryption for Laravel applications

642.6k](/packages/ercsctt-laravel-file-encryption)

PHPackages © 2026

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