PHPackages                             michaeljmeadows/has-histories - 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. michaeljmeadows/has-histories

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

michaeljmeadows/has-histories
=============================

A simple trait to aid Eloquent model version history logging.

v2.0.0(2y ago)023MITPHPPHP ^8.0

Since Nov 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/michaeljmeadows/has-histories)[ Packagist](https://packagist.org/packages/michaeljmeadows/has-histories)[ RSS](/packages/michaeljmeadows-has-histories/feed)WikiDiscussions main Synced 1mo ago

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

michaeljmeadows/has-histories
=============================

[](#michaeljmeadowshas-histories)

A simple trait to aid Eloquent model version history logging.

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

[](#installation)

You can install the package via composer:

```
composer require michaeljmeadows/has-histories

```

Usage
-----

[](#usage)

Add a migration to store your model histories. This should contain all the same fields as your main model table as well as a reference ID to the original model. Your model's history table can be named however your like, but the default convention would be `models` -&gt; `model_histories`. We recommend modifying your migrations as shown in this modification of the Laravel Jetstream User migration:

```
