PHPackages                             peters-development/laravel-model-logger - 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. peters-development/laravel-model-logger

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

peters-development/laravel-model-logger
=======================================

Lightweight polymorphic model activity logging for Laravel.

v1.0.0(1mo ago)00MITPHPPHP ^8.2

Since Mar 14Pushed 1mo agoCompare

[ Source](https://github.com/Peters-Development/laravel-model-logger)[ Packagist](https://packagist.org/packages/peters-development/laravel-model-logger)[ RSS](/packages/peters-development-laravel-model-logger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Laravel Model Logger
====================

[](#laravel-model-logger)

Lightweight polymorphic model activity logging for Laravel.

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

[](#installation)

```
composer require peters-development/laravel-model-logger
```

The service provider is auto-discovered. Migrations run automatically.

Usage
-----

[](#usage)

Add the `HasModelLogs` trait to any Eloquent model:

```
use PetersDevelopment\ModelLogger\HasModelLogs;

class Order extends Model
{
    use HasModelLogs;
}
```

Then log activity:

```
$order->log('Order was shipped');
$order->log('Payment received', ['amount' => 99.99, 'method' => 'ideal']);

// Retrieve logs
$order->logs; // Collection of ModelLog
```

The authenticated user is automatically recorded. Meta data is stored as JSON.

The `log()` method returns the created `ModelLog` instance:

```
$log = $order->log('Status changed', ['from' => 'pending', 'to' => 'shipped']);
```

Querying Logs
-------------

[](#querying-logs)

Access the user that performed the action:

```
$log->user; // Returns the User model
```

Filter logs by user:

```
use PetersDevelopment\ModelLogger\ModelLog;

$logs = ModelLog::forUser($userId)->get();
```

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

[](#configuration)

Publish the config to customize the table name:

```
php artisan vendor:publish --tag=model-logger-config
```

```
// config/model-logger.php
return [
    'table_name' => 'model_logs',
];
```

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance88

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

59d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravellaravel-frameworklaravel-loggerlaravel-logginglaravel-packagepackagephp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/peters-development-laravel-model-logger/health.svg)

```
[![Health](https://phpackages.com/badges/peters-development-laravel-model-logger/health.svg)](https://phpackages.com/packages/peters-development-laravel-model-logger)
```

###  Alternatives

[spatie/laravel-activitylog

A very simple activity logger to monitor the users of your website or application

5.8k45.4M309](/packages/spatie-laravel-activitylog)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[label84/laravel-auth-log

Log user authentication actions in Laravel.

3654.0k](/packages/label84-laravel-auth-log)[directorytree/metrics

Record metrics in your Laravel application

26027.8k](/packages/directorytree-metrics)[masterro/laravel-mail-viewer

Easily view in browser outgoing emails.

6392.1k](/packages/masterro-laravel-mail-viewer)

PHPackages © 2026

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