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. [Database &amp; ORM](/categories/database)
4. /
5. tochka-developers/model-history

ActivePackage[Database &amp; ORM](/categories/database)

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

Simple history for Laravel models

v0.6.0(2w ago)02.4kPHPPHP 8.1.\*|8.2.\*|8.3.\*|8.4.\*

Since Apr 28Pushed 2w 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 (6)Dependencies (4)Versions (10)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

51

↑

FairBetter than 95% of packages

Maintenance97

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

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

Recently: every ~480 days

Total

6

Last Release

17d ago

PHP version history (5 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.\*

v0.6.0PHP 8.1.\*|8.2.\*|8.3.\*|8.4.\*

### 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 (7 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

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.9M110](/packages/mongodb-laravel-mongodb)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8723.3M27](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.6M2](/packages/glushkovds-phpclickhouse-laravel)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[laravel-liberu/laravel-gedcom

A package that converts gedcom files to Eloquent models

792.5k1](/packages/laravel-liberu-laravel-gedcom)

PHPackages © 2026

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