PHPackages                             mrunknown0001/laravel-login-monitor - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. mrunknown0001/laravel-login-monitor

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

mrunknown0001/laravel-login-monitor
===================================

Laravel package for monitoring login activities and sending beacons to a monitoring host

v1.6.0(6mo ago)029MITPHPPHP ^8.1|^8.2|^8.3|^8.4

Since Nov 10Pushed 6mo agoCompare

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

READMEChangelog (3)Dependencies (6)Versions (11)Used By (0)

Laravel Login Monitor
=====================

[](#laravel-login-monitor)

A simple Laravel package to monitor login activities and database mutations, sending beacons to a designated monitoring host.

Features
--------

[](#features)

- 🔐 Automatic tracking of login successes, failures, and logouts
- 🗃️ Observes create, update, and delete operations across Eloquent models and raw/query builder mutations
- 📡 Sends beacons to your monitoring host via HTTP
- 🧠 Enriches each beacon with contextual metadata (acting user, request details, table names, record identifiers)
- 🌐 Captures IP address, user agent, full URL, HTTP method, and timestamps
- ⚙️ Configurable and easy to set up
- 🚀 Non-blocking async requests

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

[](#installation)

Install via Composer:

```
composer require mrunknown0001/laravel-login-monitor --no-scripts
```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=login-monitor-config
```

Add to your `.env` file:

```
LOGIN_MONITOR_HOST=https://your-monitor-host.com
LOGIN_MONITOR_ENABLED=true
```

Usage
-----

[](#usage)

The package automatically tracks authentication events and database mutations (create, update, delete) initiated through Eloquent models or the query builder. No additional instrumentation is required.

### Manual Beacon Sending

[](#manual-beacon-sending)

```
use Mrunknown0001\LaravelLoginMonitor\Facades\LoginMonitor;

LoginMonitor::sendBeacon([
    'event' => 'custom_event',
    'data' => 'your custom data',
]);
```

### Events Captured

[](#events-captured)

EventTriggered whenMeta payload highlights`login_success`A user successfully authenticates`user_id`, `email`, request context (IP, UA, HTTP method, URL)`login_failed`An authentication attempt fails`email`, request context`logout`A user logs out`user_id`, request context`record_created`A record is inserted via Eloquent or the query builder`table`, `record_id`, `attributes`, actor + request context`record_updated`A record is updated via Eloquent or the query builder`table`, `record_id`, `changes`, `original`, actor + request context`record_delete`A record is deleted via Eloquent or the query builder`table`, `record_id`, `original`, actor + request context> **Note:** Query builder mutations are automatically detected while avoiding duplicate beacons for Eloquent operations.

### Example: Manual Mutation Recording

[](#example-manual-mutation-recording)

```
use Mrunknown0001\LaravelLoginMonitor\Facades\LoginMonitor;

/** @var \Illuminate\Database\Eloquent\Model $model */
LoginMonitor::recordCreated($model);

// For non-model contexts (jobs, scripts) using the query builder:
LoginMonitor::recordQueryBuilderOperation('update', [
    'table' => 'orders',
    'record_id' => 42,
    'changes' => ['status' => 'shipped'],
]);
```

Beacon Format
-------------

[](#beacon-format)

All beacons are POSTed to `/api/login-monitor` with the following base structure:

- `event`: The event name (e.g., `login_success`, `record_updated`)
- `meta`: Contextual payload gathered for the event
- `app_name`, `app_url`, `timestamp`: Automatic application metadata

### Example: Login Success

[](#example-login-success)

```
{
    "event": "login_success",
    "user_id": 123,
    "email": "user@example.com",
    "ip_address": "192.168.1.1",
    "user_agent": "Mozilla/5.0 ...",
    "app_name": "Your App",
    "app_url": "https://yourapp.com",
    "timestamp": "2025-11-10T12:00:00+00:00"
}
```

### Example: Record Update

[](#example-record-update)

```
{
    "event": "record_updated",
    "meta": {
        "operation": "update",
        "table": "orders",
        "record_id": 42,
        "changes": {
            "status": "shipped"
        },
        "original": {
            "status": "processing"
        },
        "context": {
            "acting_user_id": 1,
            "acting_user_class": "App\\Models\\User",
            "ip_address": "192.168.1.1",
            "user_agent": "Mozilla/5.0 ...",
            "url": "https://yourapp.com/orders/42",
            "http_method": "PUT"
        }
    },
    "app_name": "Your App",
    "app_url": "https://yourapp.com",
    "timestamp": "2025-11-10T12:00:00+00:00"
}
```

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

[](#requirements)

- PHP 8.1 or higher
- Laravel 9.x, 10.x, 11.x, 12.x

License
-------

[](#license)

MIT License

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance69

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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

8

Last Release

183d ago

PHP version history (2 changes)v1.0.0PHP ^8.0|^8.1|^8.2|^8.3

v1.0.1PHP ^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/662674170e6d7cb1527e292520309faaa43300b616e50af18fe83425ef3985a0?d=identicon)[mrunknown0001](/maintainers/mrunknown0001)

---

Top Contributors

[![mrunknown0001](https://avatars.githubusercontent.com/u/11643789?v=4)](https://github.com/mrunknown0001 "mrunknown0001 (13 commits)")

---

Tags

laravelmonitoringsecurityAuthenticationloginbeacon

### Embed Badge

![Health badge](/badges/mrunknown0001-laravel-login-monitor/health.svg)

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

###  Alternatives

[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)

PHPackages © 2026

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