PHPackages                             johannesschobel/laravel-revisionable - 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. [Database &amp; ORM](/categories/database)
4. /
5. johannesschobel/laravel-revisionable

ActiveLibrary[Database &amp; ORM](/categories/database)

johannesschobel/laravel-revisionable
====================================

Makes Laravel Models revisionable

0.1(8y ago)176.3k2[3 issues](https://github.com/johannesschobel/laravel-revisionable/issues)1MITPHPPHP &gt;=5.6.4

Since May 29Pushed 8y ago2 watchersCompare

[ Source](https://github.com/johannesschobel/laravel-revisionable)[ Packagist](https://packagist.org/packages/johannesschobel/laravel-revisionable)[ RSS](/packages/johannesschobel-laravel-revisionable/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (7)Versions (2)Used By (1)

JohannesSchobel/Laravel-Revisionable
====================================

[](#johannesschobellaravel-revisionable)

Easy and conventient way to handle revisions of your models within the database.

- Handles the revisions in **bulk** - one entry covers all the created/updated fields, what makes it really **easy to e.g., compare 2 given versions** or get all the data changed during one single transaction.

Requirements
------------

[](#requirements)

- This package requires PHP 5.4+
- Currently it works out of the box with Laravel5.4 + generic Illuminate Guard, tymon/jwt-auth OR cartalyst/sentry 2/sentinel 2

Usage (Laravel 5 basic example - see Customization below as well)
-----------------------------------------------------------------

[](#usage-laravel-5-basic-example---see-customization-below-as-well)

### 1. Download the package or require in your `composer.json`:

[](#1-download-the-package-or-require-in-your-composerjson)

```
composer require johannesschobel/laravel-revisionable

```

### 2. Add the service provider to your `app/config/app.php`:

[](#2-add-the-service-provider-to-your-appconfigappphp)

```
    'providers' => array(
        ...
        'JohannesSchobel\Revisionable\RevisionableServiceProvider',
    ),
```

### 3. Publish the package config file:

[](#3-publish-the-package-config-file)

```
~$ php artisan vendor:publish [--provider="JohannesSchobel\Revisionable\RevisionableServiceProvider"]

```

this will create `config/revisionable.php` file, where you can adjust a few settings.

### 4. Run the migration in order to create the revisions table:

[](#4-run-the-migration-in-order-to-create-the-revisions-table)

```
~$ php artisan migrate

```

### 5. Add revisionable trait to the models you wish to keep track of:

[](#5-add-revisionable-trait-to-the-models-you-wish-to-keep-track-of)

```
