PHPackages                             ajayjoshi/polymorphic-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. ajayjoshi/polymorphic-history

ActiveLibrary

ajayjoshi/polymorphic-history
=============================

This Package is used for managing model histories using polymorphic relations

0251PHP

Since Oct 17Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Ajay-joshi-mtr/PolymorphicHistory)[ Packagist](https://packagist.org/packages/ajayjoshi/polymorphic-history)[ RSS](/packages/ajayjoshi-polymorphic-history/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Logging Actions
===============

[](#logging-actions)

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

[](#installation)

You can install the package via composer:

```
composer require AjayJoshi/polymorphic-history

php artisan vendor:publish --provider="AjayJoshi\PolymorphicHistory\PolymorphicHistoryServiceProvider"
```

Usage
-----

[](#usage)

Use Trait in Model
------------------

[](#use-trait-in-model)

```
use AjayJoshi\PolymorphicHistory\Traits\ModelHistoryTrait;

class Order extends Model
{
    use HasFactory;

    use ModelHistoryTrait;
```

Extend Actions
--------------

[](#extend-actions)

```
use AjayJoshi\PolymorphicHistory\Enums\ModelHistoryEnum;

class HistoryActions extends ModelHistoryEnum {

   const ORDER_CREATED = 100;
   const ORDER_UPDATED = 101;
   const ORDER_DELETED = 102;

   //... So on

}
```

```
#use Faced or $model

\ModelAction::log($model,HistoryActions::PURCHASE_ORDER_EXTENDED,'test','remark');

#list morphmanyrelation objects

foreach($model->modelActivity as $acitivity)
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Ajay Joshi](https://github.com/Ajay-Joshi-mtr)

License
-------

[](#license)

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

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/782d5ff7ddcf856d3dd2aeff187bd56adeb173829cdd872ab45f860e88994893?d=identicon)[Ajayjoshi](/maintainers/Ajayjoshi)

---

Top Contributors

[![Ajay-joshi-mtr](https://avatars.githubusercontent.com/u/34390774?v=4)](https://github.com/Ajay-joshi-mtr "Ajay-joshi-mtr (10 commits)")[![ajayjoshioutdosolutions](https://avatars.githubusercontent.com/u/107848970?v=4)](https://github.com/ajayjoshioutdosolutions "ajayjoshioutdosolutions (10 commits)")

### Embed Badge

![Health badge](/badges/ajayjoshi-polymorphic-history/health.svg)

```
[![Health](https://phpackages.com/badges/ajayjoshi-polymorphic-history/health.svg)](https://phpackages.com/packages/ajayjoshi-polymorphic-history)
```

PHPackages © 2026

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