Documentation

Edit

Revisions


About

Revisions allows your admins to store, see and undo changes to entries on an Eloquent model.

The operation provides you with a simple interface to work with venturecraft/revisionable, which is a great pacakge that stores all changes in a separate table. It can work as an audit trail, a backup system and an accountability system for the admins.

When enabled, Revisions will show another button in the table view, between Edit and Delete. On click, that button opens another page which will allow an admin to see all changes and who made them:

CRUD Revision Operation

How to Use

The Reorder operation is disabled by default. In order to enable this functionality for a CRUD panel, you need to:

  1. Create the revisions table:
cp vendor/venturecraft/revisionable/src/migrations/2013_04_09_062329_create_revisions_table.php database/migrations/ && php artisan migrate
  1. Use venturecraft/revisionable on your model. If you are using another bootable trait be sure to override the boot method in your model.
namespace MyApp\Models;

class Article extends Eloquent {
    use \Backpack\CRUD\CrudTrait, \Venturecraft\Revisionable\RevisionableTrait;

    // If you are using another bootable trait
    // be sure to override the boot method in your model
    public static function boot()
    {
        parent::boot();
    }
}
  1. In your EntityCrudController's setup() method, enable access to the Revisions operation:
$this->crud->allowAccess('revisions');
  1. [optional] If you want the table view to load faster (and why wouldn't you?), you should eager-load the revisions, so there won't be any extra DB queries for the revisions:
$this->crud->with('revisionHistory');

For complex usage, head on over to VentureCraft/revisionable to see the full documentation and extra configuration options.

Please purchase a commercial license or apply for a non-commercial license code before you put your project online, to prevent nagging notification bubbles.