PHPackages                             robmellett/laravel-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. robmellett/laravel-model-history

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

robmellett/laravel-model-history
================================

A simple trait to add to your models so you can store CREATED and UPDATED differences

1.1.0(1y ago)219[4 PRs](https://github.com/robmellett/laravel-model-history/pulls)MITPHPPHP ^8.2

Since Nov 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/robmellett/laravel-model-history)[ Packagist](https://packagist.org/packages/robmellett/laravel-model-history)[ Docs](https://github.com/robmellett/laravel-model-history)[ RSS](/packages/robmellett-laravel-model-history/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (13)Versions (7)Used By (0)

[![](https://camo.githubusercontent.com/2bedf63f24cda7efab02da955dc11fb7ef8a060e2f26b73c33a7aac84529b8a3/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f737570706f72742d756b7261696e652e7376673f743d31)](https://supportukrainenow.org)

Track model history
===================

[](#track-model-history)

[![Latest Version on Packagist](https://camo.githubusercontent.com/73c88688f6311101139c2e244b6fd43210f16da8bc93c2f412fe8c3e89a1d969/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f626d656c6c6574742f6c61726176656c2d6d6f64656c2d686973746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/robmellett/laravel-model-history)[![GitHub Tests Action Status](https://camo.githubusercontent.com/fafb43e70fd66bc4578dd394702a605da8f400979721a14cacf18191de4fac61/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f726f626d656c6c6574742f6c61726176656c2d6d6f64656c2d686973746f72792f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/robmellett/laravel-model-history/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/3fd0af60e0986a5afe62b9b3c9d5473be02c54cd12611ac88935c4b8abfbc7f7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f726f626d656c6c6574742f6c61726176656c2d6d6f64656c2d686973746f72792f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/robmellett/laravel-model-history/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/e2fbebb39383af2f9100b03d1337f1c65320dd8fe2c6ca0a57d3e38734633a77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f626d656c6c6574742f6c61726176656c2d6d6f64656c2d686973746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/robmellett/laravel-model-history)

This little package will create a `history_events` table, so that you can track model Created and Updated events, along with the data changing between updates.

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

[](#installation)

You can install the package via composer:

```
composer require robmellett/laravel-model-history
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="model-history-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="model-history-config"
```

This is the contents of the published config file:

```
return [
];
```

Usage
-----

[](#usage)

You can add the `Historize` trait to your model, and the CREATED and UPDATED events will be fired when the model is created and updated.

```
class Product extends Model
{
    use Historize;
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/robmellett/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Rob Mellett](https://github.com/robmellett)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

712d ago

### Community

Maintainers

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

---

Top Contributors

[![robmellett](https://avatars.githubusercontent.com/u/26024074?v=4)](https://github.com/robmellett "robmellett (13 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")

---

Tags

laravelrobmellettlaravel-model-history

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/robmellett-laravel-model-history/health.svg)

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

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[spatie/laravel-model-flags

Add flags to Eloquent models

4301.1M1](/packages/spatie-laravel-model-flags)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[spatie/laravel-sql-commenter

Add comments to SQL queries made by Laravel

1931.4M1](/packages/spatie-laravel-sql-commenter)[spatie/laravel-deleted-models

Automatically copy deleted records to a separate table

409109.8k4](/packages/spatie-laravel-deleted-models)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

203330.1k2](/packages/wnx-laravel-backup-restore)

PHPackages © 2026

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