PHPackages                             tannhatcms/revise-operation - 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. [Admin Panels](/categories/admin)
4. /
5. tannhatcms/revise-operation

ActiveLibrary[Admin Panels](/categories/admin)

tannhatcms/revise-operation
===========================

Backpack interface for venturecraft/revisionable

2.0.1(1y ago)03MITPHP

Since Mar 21Pushed 4mo agoCompare

[ Source](https://github.com/TanNhatCMS/Laravel-Backpack-revise-operation)[ Packagist](https://packagist.org/packages/tannhatcms/revise-operation)[ Docs](https://github.com/laravel-backpack/revise-operation)[ RSS](/packages/tannhatcms-revise-operation/feed)WikiDiscussions dev Synced 1mo ago

READMEChangelogDependencies (2)Versions (21)Used By (0)

ReviseOperation for Backpack for Laravel
========================================

[](#reviseoperation-for-backpack-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8624b7975e64192fdd2e228cb767a0bc0c45e466871bfc1abe5b891db2345422/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6261636b7061636b2f7265766973652d6f7065726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/backpack/revise-operation)[![Software License](https://camo.githubusercontent.com/5a202d5327ab4ae3bf5cc50fcfa3d2f0823d818a4f115a027d8176dcb996c4d4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d6475616c2d626c75653f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/7ed24fb3f016d55129bae68715d7700252c3aa5476455270f8a3ddd0cd8eeacd/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6261636b7061636b2f7265766973652d6f7065726174696f6e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/backpack/revise-operation)[![Total Downloads](https://camo.githubusercontent.com/9cf80fa578d3e4872344f096185300997ddce66877c687f9d82efff8779049a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6261636b7061636b2f7265766973652d6f7065726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/backpack/revise-operation)[![StyleCI](https://camo.githubusercontent.com/47bb144cdcf184aadc1c75b776088d06bf9acfb4d298206a196c04392fa029f2/68747470733a2f2f7374796c6563692e696f2f7265706f732f3234383936303931322f736869656c64)](https://styleci.io/repos/248960912)

Adds an interface for [`venturecraft/revisionable`](https://github.com/VentureCraft/revisionable) to your Backpack CRUDs, so that the admin can:

- see the changes that have been made to an entry;
- undo changes;

[`venturecraft/revisionable`](https://github.com/VentureCraft/revisionable) allows you to store, see and undo changes to entries on an Eloquent model. This package just provides an admin interface for it, in the form of a Backpack operation, that you can use on the CrudControllers of entities that have the Revisionable trait.

When used, this operation will show another button for each entry in the table view. On click, that button opens another page, which will allow an admin to see all changes and who made them:

[![https://backpackforlaravel.com/uploads/docs-4-0/operations/revisions.png](https://camo.githubusercontent.com/1c54b5c87486fe5a627c3b013953d326e8355ee49a34913a2845ecfc638a907b/68747470733a2f2f6261636b7061636b666f726c61726176656c2e636f6d2f75706c6f6164732f646f63732d342d302f6f7065726174696f6e732f7265766973696f6e732e706e67)](https://camo.githubusercontent.com/1c54b5c87486fe5a627c3b013953d326e8355ee49a34913a2845ecfc638a907b/68747470733a2f2f6261636b7061636b666f726c61726176656c2e636f6d2f75706c6f6164732f646f63732d342d302f6f7065726174696f6e732f7265766973696f6e732e706e67)

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

[](#installation)

**Step 1.** Require the package:

```
composer require backpack/revise-operation
```

This will automatically install `venturecraft/revisionable` too, if it's not already installed.

**Step 2.** Create the Revisions table:

```
cp vendor/venturecraft/revisionable/src/migrations/2013_04_09_062329_create_revisions_table.php database/migrations/ && php artisan migrate
```

**Step 3.** Use RevisionableTrait on your model, and an `identifiableName()` method that returns an attribute on the model that the admin can use to distiguish between entries (ex: name, title, etc). 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;

    public function identifiableName()
    {
        return $this->name;
    }

    // If you are using another bootable trait
    // be sure to override the boot method in your model
    public static function boot()
    {
        parent::boot();
    }
}
```

**Step 4.** In your CrudController, use the operation trait:

```
