PHPackages                             thanhvocse/history-plugin - 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. thanhvocse/history-plugin

ActiveOctober-plugin[Utility &amp; Helpers](/categories/utility)

thanhvocse/history-plugin
=========================

Model history for OctoberCMS

v1.0.3(8mo ago)2631MITPHPPHP &gt;=7.2

Since Sep 20Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/thanhvo-cse/history-plugin)[ Packagist](https://packagist.org/packages/thanhvocse/history-plugin)[ RSS](/packages/thanhvocse-history-plugin/feed)WikiDiscussions main Synced 1mo ago

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

Model History Plugin
====================

[](#model-history-plugin)

- Add revision history to October CMS backend.
- Every updates on a model could be tracked as revisions, with user, time and changes in detail.

Requirements
============

[](#requirements)

- October CMS 1.0 or above

Installation Instructions
-------------------------

[](#installation-instructions)

```
php artisan plugin:install ThanhVoCSE.History

```

Or

```
composer require thanhvocse/history-plugin
php artisan october:migrate

```

Controller Behavior
-------------------

[](#controller-behavior)

Configuring the Relation Behavior and History Behavior

```
class Users extends Controller
{
    public $implement = [
        \Backend\Behaviors\FormController::class,
        \Backend\Behaviors\ListController::class,
        \Backend\Behaviors\RelationController::class,
        \ThanhVoCSE\History\Behaviors\HistoryController::class,
    ];

    public $formConfig = 'config_form.yaml';
    public $listConfig = 'config_list.yaml';
    public $relationConfig = 'config_relation.yaml';
}
```

Then define the histories relation. The histories relation config below is optional only when you want to customize it.

```
# config_relation.yaml
histories:
    view:
        recordsPerPage: 10
        defaultSort:
            - column: version
            - direction: desc
```

Displaying a Relation Manager
-----------------------------

[](#displaying-a-relation-manager)

The relation manager can then be displayed for a specified relation definition by calling the relationRender method. For example, if you want to display the relation manager on the Preview page, the preview.php view contents could look like this.

```
