PHPackages                             geeky/historical-model - 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. geeky/historical-model

ActiveLibrary

geeky/historical-model
======================

This package is to make a historical model for any model you want very easy and very quickly.

2.0(5y ago)05MITPHP

Since Jul 19Pushed 5y agoCompare

[ Source](https://github.com/TheGeekyM/Historical-Model)[ Packagist](https://packagist.org/packages/geeky/historical-model)[ RSS](/packages/geeky-historical-model/feed)WikiDiscussions master Synced 4w ago

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

Historical Model
================

[](#historical-model)

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

[](#installation)

Install using composer:

```
 composer require geeky/historical-model --dev

```

About
-----

[](#about)

This package created for helping you to create a historical model/data for any model/data you want, so one of the solutions of creating a historical data os by creating a history table for the basic table, so if we have a table called employees with this columns:

```
  - id
  - name
  - salary
  - address
  - created_at
  - updated_at

```

and we want to make save our data in another place in case if the employee changes his address or his salary for example, like if the salary of an employee is 500$ then he updated the salary to be 1000$ then 1500$ so we want to save all of these data to have a historical data to know when the employee was 1000$ or something else, Our history table schema will be:

```
  - id - primary key. Detail/historical id
  - master_id - for example in this case called 'employee_id', this is the FK to the Master record
  - start_datetime - timestamp indicating the start of that database row
  - end_datetime - timestamp indicating the end of that database row
  - status control - single char column indicated status of the row. 'c' indicates current, NULL or 'a' would be historical/archived. We only use this because we can't index on END_DATETIME being NULL
  - created_by_id - stores the ID of the account that caused the row to be created
  - the_columns_you_choose_to_log - stores the actual data

```

Usage
-----

[](#usage)

you can create the historical model/data just by a very easy command

- `php artisan make:history-model`

then you will be asked what model you want to make it historical,

[![Screenshot](https://camo.githubusercontent.com/434746f337c6be8daecd30acfa4eb0d41182c4b1b896da2a93b1566ca60b56fb/68747470733a2f2f692e6962622e636f2f334d5478736a462f53637265656e73686f742d66726f6d2d323032302d30372d31392d30312d33322d35302e706e67)](https://camo.githubusercontent.com/434746f337c6be8daecd30acfa4eb0d41182c4b1b896da2a93b1566ca60b56fb/68747470733a2f2f692e6962622e636f2f334d5478736a462f53637265656e73686f742d66726f6d2d323032302d30372d31392d30312d33322d35302e706e67)

and the package will automatically get your columns and ask you column column with y/n if you to log it, and hola you will get your model and your migration file ready to migrate.

[![Screenshot](https://camo.githubusercontent.com/fcd0617d03636e9eaf9efad0b4b17115680748650001ef3f6a85cf8acdd8eeee/68747470733a2f2f692e6962622e636f2f507768515432722f53637265656e73686f742d66726f6d2d323032302d30372d31392d30312d33332d32352e706e67)](https://camo.githubusercontent.com/fcd0617d03636e9eaf9efad0b4b17115680748650001ef3f6a85cf8acdd8eeee/68747470733a2f2f692e6962622e636f2f507768515432722f53637265656e73686f742d66726f6d2d323032302d30372d31392d30312d33332d32352e706e67)

Important
---------

[](#important)

> You should use the `Geeky\Historical\Concerns\Historical` trait file in your base model

Todo List
---------

[](#todo-list)

- Add a command to sync the base data from the base table to the historical table
- Add the trait automatically to the base model
- Remove the timestamps() from the migration file

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

Every ~8 days

Total

2

Last Release

2111d ago

Major Versions

1.0 → 2.02020-07-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/969bfcf4457bc5199ca47192dfcb06c61991739f2968f748e41f4ad83e8e2df0?d=identicon)[TheGeeky](/maintainers/TheGeeky)

---

Top Contributors

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

---

Tags

laravelmodelhistoryhistoricalhistorical model

### Embed Badge

![Health badge](/badges/geeky-historical-model/health.svg)

```
[![Health](https://phpackages.com/badges/geeky-historical-model/health.svg)](https://phpackages.com/packages/geeky-historical-model)
```

###  Alternatives

[venturecraft/revisionable

Keep a revision history for your models without thinking, created as a package for use with Laravel

2.6k6.6M51](/packages/venturecraft-revisionable)

PHPackages © 2026

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