Skip to content

Commit 071f83c

Browse files
committed
#100 - Readme: Add an example for apply revisionable trait to model
1 parent f840ec6 commit 071f83c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,20 @@ To enable revisions on your Model do the following:
9191
$ php artisan migrate --path=vendor/venturecraft/revisionable/src/migrations #run revisionable migrations
9292
```
9393

94-
2. Add the `\Venturecraft\Revisionable\RevisionableTrait` Trait to your Model.
94+
2. Add the `\Venturecraft\Revisionable\RevisionableTrait` Trait to your Model. E.g:
95+
```php
96+
namespace MyApp\Models;
97+
98+
class Article extends Eloquent {
99+
use \Backpack\CRUD\CrudTrait, \Venturecraft\Revisionable\RevisionableTrait;
100+
101+
// If you are using another bootable trait the be sure to override the boot method in your model
102+
public static function boot()
103+
{
104+
parent::boot();
105+
}
106+
}
107+
```
95108

96109
3. Enable access to Revisions in your CrudController with:
97110
```php

0 commit comments

Comments
 (0)