PHPackages                             cranky4/change-log-behavior - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cranky4/change-log-behavior

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cranky4/change-log-behavior
===========================

Simple changelog behavior for yii2 models

1.0.8(3y ago)1626.3k↓26.3%14[1 issues](https://github.com/Cranky4/change-log-behavior/issues)[1 PRs](https://github.com/Cranky4/change-log-behavior/pulls)MITPHP

Since Jul 18Pushed 3y ago2 watchersCompare

[ Source](https://github.com/Cranky4/change-log-behavior)[ Packagist](https://packagist.org/packages/cranky4/change-log-behavior)[ RSS](/packages/cranky4-change-log-behavior/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (22)Used By (0)

Changelog Behavior simplified(v.1.0.0)
======================================

[](#changelog-behavior-simplifiedv100)

Simple behavior for your yii2-models

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

[](#installation)

1- Install package via composer:

```
composer require cranky4/change-log-behavior "*"

```

2- Run migrations:

```
yii migrate --migrationPath=@vendor/cranky4/change-log-behavior/src/migrations

```

Usage
-----

[](#usage)

1- Add *ChangeLogBehavior* to any model or active record:

```
public function behaviors()
{
    return [
        ...
        [
            'class' => ChangeLogBehavior::className(),
            'excludedAttributes' => ['updated_at'],
        ],
        ...
    ];
}
```

**Attention:** Behavior watches to "safe" attributes only. Add attributes into *excludedAttributes* if you don't want to log its changes.

2- Add *ChangeLogList* to view:

```
 echo ChangeLogList::widget([
     'model' => $model,
 ])
```

3- Add custom log:

```
$model->addCustomLog('hello world!', 'hello_type')
```

### Example

[](#example)

Model *Post*

```
/**
 * @propertu int id
 * @property int created_at
 * @property int updated_at
 * @property string title
 * @property int rating
 */
class Post extends yii\db\ActiveRecord {

    /**
     *  @inheritdoc
     */
    public function behaviors()
    {
        return [
            [
                'class' => ChangeLogBehavior::class,
                'excludedAttributes' => ['created_at','updated_at'],
            ]
        ];
    }

}
```

View *post/view.php*

```
use cranky4\ChangeLogBahavior\ListWidget as ChangeLogList;
use app\models\Post;

/**
 *  @var Post $model
 */
echo DetailView::widget([
    'model' => $model,
    'attributes' => [
        'id',
        'title',
        'rating',
        'created_at:datetime',
        'updated_at:datetime',
    ],
]);

echo ChangeLogList::widget([
    'model' => $model,
]);
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 91.3% 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 ~113 days

Recently: every ~386 days

Total

21

Last Release

1323d ago

Major Versions

0.1.4 → 1.0.02018-07-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/615a23272708e8b7a1eb54bf5f6d3ae521f065baf407e8e9af017be3bd416bc0?d=identicon)[Cranky4](/maintainers/Cranky4)

---

Top Contributors

[![Cranky4](https://avatars.githubusercontent.com/u/5602347?v=4)](https://github.com/Cranky4 "Cranky4 (42 commits)")[![angryjack](https://avatars.githubusercontent.com/u/33295841?v=4)](https://github.com/angryjack "angryjack (1 commits)")[![avbondarev](https://avatars.githubusercontent.com/u/491595?v=4)](https://github.com/avbondarev "avbondarev (1 commits)")[![nfacha](https://avatars.githubusercontent.com/u/8540172?v=4)](https://github.com/nfacha "nfacha (1 commits)")[![seisvalt](https://avatars.githubusercontent.com/u/295823?v=4)](https://github.com/seisvalt "seisvalt (1 commits)")

---

Tags

yii2changelog

### Embed Badge

![Health badge](/badges/cranky4-change-log-behavior/health.svg)

```
[![Health](https://phpackages.com/badges/cranky4-change-log-behavior/health.svg)](https://phpackages.com/packages/cranky4-change-log-behavior)
```

###  Alternatives

[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)

PHPackages © 2026

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