Skip to content

Commit

Permalink
updated readme to contain inclusion of timestamps into a revision
Browse files Browse the repository at this point in the history
  • Loading branch information
zbiller committed Apr 16, 2019
1 parent 52e68a3 commit 146ff20
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,25 @@ public function getRevisionOptions(): RevisionOptions
}
```

### Include timestamps when creating a revision

By default, when creating a revision, the actual model's timestamps are automatically excluded from the actual revision data.

If you'd like to store the model's timestamps when creating a revision, please use the `withTimestamps()` method in your definition of the `getRevisionOptions()` method.

```php
/**
* Get the options for revisioning the model.
*
* @return RevisionOptions
*/
public function getRevisionOptions(): RevisionOptions
{
return RevisionOptions::instance()
->withTimestamps();
}
```

### Revision relationships alongside the model record

More often than not you will want to create a full copy in time of the model record and this includes revisioning its relations too (especially child relations).
Expand Down

0 comments on commit 146ff20

Please sign in to comment.