PHPackages                             tochka-developers/model-history - 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. tochka-developers/model-history

ActivePackage

tochka-developers/model-history
===============================

Simple history for Laravel models

v0.5.0(1y ago)02.4kPHPPHP ^7.4|8.0.\*|8.1.\*|8.2.\*|8.3.\*

Since Apr 28Pushed 1y ago5 watchersCompare

[ Source](https://github.com/tochka-developers/model-history)[ Packagist](https://packagist.org/packages/tochka-developers/model-history)[ RSS](/packages/tochka-developers-model-history/feed)WikiDiscussions master Synced today

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

History for Laravel Models
==========================

[](#history-for-laravel-models)

Easily add keeping track of model modifications.

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

[](#installation)

1. Add `"tochka-developers/model-history":"^0.1"` to the `require` section of your `composer.json`
2. Publish package assets:

```
php artisan vendor:publish
```

3. You may now edit the config file `model-history.php` to specify the name of the table to store history records. Please do it *before*running the migrations. Default name is `history` which is quite reasonable.
4. Use `\Tochka\ModelHistory\HasHistory` trait in your model.

History structure
-----------------

[](#history-structure)

History records for all tracked models are stored in the same table specified in the config file (`history` is the default name). Each record contains the following data:

- `changed_at` - time of modification;
- `entity_name` - name of the table containing tracked model records;
- `entity_id` - ID of the row in the tracked table the history entry relates to;
- `action` - type of modification. The possible values are `create`, `update`, `delete` and `restore`.
- `new_data` - a JSON containing *new* values. Therefore each history record is essentially a diff to the previous version of the model.

Warning
-------

[](#warning)

The history table always grows and is NEVER CLEANED UP by this package. Please consider the possibility of the history table becoming the largest in your database and occupying more space than all other tables ultimately exhausting all available disk space.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance40

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~325 days

Total

5

Last Release

534d ago

PHP version history (4 changes)v0.1.0PHP ^7.4

v0.3.0PHP ^7.4|8.0.\*|8.1.\*

v0.4.0PHP ^7.4|8.0.\*|8.1.\*|8.2.\*

v0.5.0PHP ^7.4|8.0.\*|8.1.\*|8.2.\*|8.3.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5ec14fdcb7d670c749bdfe547cdcae4dd77a1eb173f01c6787217c8ef90b1d5?d=identicon)[tochka-developers](/maintainers/tochka-developers)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/tochka-developers-model-history/health.svg)

```
[![Health](https://phpackages.com/badges/tochka-developers-model-history/health.svg)](https://phpackages.com/packages/tochka-developers-model-history)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M682](/packages/barryvdh-laravel-ide-helper)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[api-platform/laravel

API Platform support for Laravel

59126.4k5](/packages/api-platform-laravel)[dragon-code/migrate-db

Easy data transfer from one database to another

15717.4k](/packages/dragon-code-migrate-db)[label84/laravel-auth-log

Log user authentication actions in Laravel.

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

PHPackages © 2026

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