Skip to content

Keep a revision history for your eloquent models without thinking

License

Notifications You must be signed in to change notification settings

convenia/revisionable

Repository files navigation

Laravel revisionable

logo


Easily create a revision history for any Eloquent model

namespace App;

use Convenia\Revisionable\RevisionableTrait;

class Article extends Eloquent {
  
    use RevisionableTrait;
}

And you're good to go!


This project is a fork of https://github.com/VentureCraft/revisionable with some improvements and new features

The v1 readme is also available if you want to use an old 1.x version


Packagist Build Status StyleCI Codacy Badge Codacy Badge Code Climate Packagist

Installation

Via composer (recommended)

composer require convenia/revisionable:^2.0

Next, you must install the service provider:

// config/app.php
'providers' => [
    ...
    Convenia\Revisionable\RevisionableServiceProvider::class,
];

You can publish the migration with:

php artisan vendor:publish --provider="Convenia\Revisionable\RevisionableServiceProvider" --tag="migrations"

After the migration has been published you can create the revisions table by running the migrations:

php artisan migrate

Contributing

Contributions are encouraged and welcome; to keep things organised, all bugs and requests should be opened in the GitHub issues tab for the main project, at convenia/revisionable/issues