PHPackages                             ctf0/odin - 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. ctf0/odin

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

ctf0/odin
=========

GUI to manage model revisions

v2.2.0(5y ago)602.2k3MITPHP

Since Nov 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ctf0/Odin)[ Packagist](https://packagist.org/packages/ctf0/odin)[ Docs](https://github.com/ctf0/Odin)[ RSS](/packages/ctf0-odin/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (5)Versions (32)Used By (0)

 Odin
 [![Latest Stable Version](https://camo.githubusercontent.com/ffe7d76816d092dd4b5ed9b7ce611b29e48149d12c33432c9f2753dd75e9553e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f637466302f6f64696e2e737667)](https://packagist.org/packages/ctf0/odin) [![Total Downloads](https://camo.githubusercontent.com/1fc434d5f9ff2ba371218f19ccec5f5144b4601d9d981329f8061924df8fe650/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f637466302f6f64696e2e737667)](https://packagist.org/packages/ctf0/odin)
=========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#----odin---------)

Manage model revisions with ease.

> If you are also looking to preview the form data before submitting to the db, you may want to give [OverSeer](https://github.com/ctf0/OverSeer) a try.

 [![](https://user-images.githubusercontent.com/7388088/33775349-be6f1696-dc46-11e7-880f-693a47d86b52.jpg)](https://user-images.githubusercontent.com/7388088/33775349-be6f1696-dc46-11e7-880f-693a47d86b52.jpg)

- package requires Laravel v5.4+

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

[](#installation)

- `composer require ctf0/odin`
- (Laravel &lt; 5.5) add the service provider &amp; facade

    ```
    'providers' => [
        ctf0\Odin\OdinServiceProvider::class,
    ];
    ```

- publish the package assets with

    `php artisan vendor:publish --provider="ctf0\Odin\OdinServiceProvider"`

- after installation, run `php artisan odin:setup` to add

    - package routes to `routes/web.php`
    - package assets compiling to `webpack.mix.js`
- check [laravel-auditing docs](http://www.laravel-auditing.com/docs/master/general-configuration) for configuration
- install dependencies

    ```
    yarn add vue vue-awesome@v2 vue-notif axios keycode
    ```
- add this one liner to your main js file and run `npm run watch` to compile your `js/css` files.

    - if you are having issues [Check](https://ctf0.wordpress.com/2017/09/12/laravel-mix-es6/).

    ```
    // app.js

    window.Vue = require('vue')

    require('../vendor/Odin/js/manager')

    new Vue({
        el: '#app'
    })
    ```

Features
--------

[](#features)

- support single &amp; nested values.
- delete &amp; restore revisions.
- support soft deletes.
- [revision preview](https://github.com/ctf0/Odin/wiki/Preview-Revision).
- clear audits for permanently deleted models.

    ```
    php artisan odin:gc
    ```

    - which can be scheduled as well ```
        $schedule->command('odin:gc')->sundays();
        ```
- shortcuts

    navigationkeyboardmouse (click)go to next revisionright/down\* *(revision date)*go to prev revisionleft/up\* *(revision date)*go to first revisionhome\* *(revision date)*go to last revisionend\* *(revision date)*hide revision windowesc\* *(x)*
- events "[JS](https://github.com/gocanto/vuemit)"

    event-namedescriptionodin-showwhen revision is showenodin-hidewhen revision is hidden

Usage
-----

[](#usage)

- run `php artisan migrate`
- add `Revisions` trait &amp; `AuditableContract` contract to your model

    - for `User model` [Check](http://laravel-auditing.com/docs/master/audit-resolvers)

    ```
    use ctf0\Odin\Traits\Revisions;
    use Illuminate\Database\Eloquent\Model;
    use OwenIt\Auditing\Contracts\Auditable as AuditableContract;

    class Post extends Model implements AuditableContract
    {
        use Revisions;

        /**
         * resolve model title/name for the revision relation
         * this is needed so we can render
         * the model relation attach/detach changes
         */
        public function getMiscTitleAttribute()
        {
            return $this->name;
        }

        // ...
    }
    ```
- you can disable creating **ghost** audits where both `old/new` values are empty by using

    - remember that without the parent model audit log we cant show the relation changes

    ```
    // app/Providers/EventServiceProvider

    use OwenIt\Auditing\Models\Audit;

    public function boot()
    {
        parent::boot();

        Audit::creating(function (Audit $model) {
            if (empty($model->old_values) && empty($model->new_values)) {
                return false;
            }
        });
    }
    ```
- inside the model view ex.`post edit view` add

    ```
    @if (count($post->revisionsWithRelation))
        @include('Odin::list', ['revisions' => $post->revisionsWithRelation])
    @endif
    ```

Notes
-----

[](#notes)

- model `user_id` &amp; `id` are excluded from the audit log by default.
- **data:uri**

    - if you use `data:uri` in your revisionable content, change [`audits_table`](https://github.com/owen-it/laravel-auditing/blob/958a6edd4cd4f9d61aa34f288f708644e150e866/database/migrations/audits.stub#L33-L34) columns type to either `mediumText` or `longText` before migrating to avoid future errors of long data.
    - because `data:uri` is a render blocking &amp; isn't readable by humans, we truncate it to 75 char max
        note that this ***ONLY*** effects the displaying of the revision diff, we never touch the data that gets saved to the db.
- **model-relation**

    - atm the relation revision is limited, it means we can only show the `attach/detach` changes but we cant `undo/redo` any of them through the package it self.
    - also if you use mass update like `Model::update()` make sure to call `$model->touch();` afterwards to make sure an audit is created ex. ```
        $model = Model::update([...]);
        $model->touch();
        ```

### Security

[](#security)

If you discover any security-related issues, please email .

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity74

Established project with proven stability

 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 ~39 days

Recently: every ~125 days

Total

31

Last Release

1933d ago

Major Versions

v1.6.0 → v2.0.02018-09-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/51dbfff65441e32301575f8ac241895817975e754d15574b86f543b33f1961f6?d=identicon)[ctf0](/maintainers/ctf0)

---

Top Contributors

[![ctf0](https://avatars.githubusercontent.com/u/7388088?v=4)](https://github.com/ctf0 "ctf0 (74 commits)")

---

Tags

diffjavascriptlaravelmanagermodelphprevisionsvuejsdifflaravelguimodelmanagerRevisionsctf0

### Embed Badge

![Health badge](/badges/ctf0-odin/health.svg)

```
[![Health](https://phpackages.com/badges/ctf0-odin/health.svg)](https://phpackages.com/packages/ctf0-odin)
```

###  Alternatives

[cybercog/laravel-paket

Composer personal web interface. Manage Laravel dependencies without switching to command line!

1753.3k](/packages/cybercog-laravel-paket)[rymanalu/factory-generator

Laravel 5 Model Factory Generator.

178.0k](/packages/rymanalu-factory-generator)

PHPackages © 2026

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