Skip to content

Commit 4c11ff4

Browse files
committed
read-me updated
1 parent e53f44f commit 4c11ff4

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

readme.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Revisionable is installable via [composer](http://getcomposer.org/doc/00-intro.m
3131
Add the following to the `require` section of your projects composer.json file:
3232

3333
```php
34-
"venturecraft/revisionable": "1.*",
34+
"cs-revisionable/revisionable": "1.*",
3535
```
3636

3737
Run composer update to download the package
@@ -185,6 +185,30 @@ protected $dontKeepRevisionOf = array(
185185

186186
> The `$keepRevisionOf` setting takes precendence over `$dontKeepRevisionOf`
187187
188+
## Custom Fields
189+
190+
For adding custom fields add $revisionsCustomFields in you model. After that add a function in your model to add the custom fields and their value while creating/updating/deleting:
191+
192+
```php
193+
protected $revisionsCustomFields;
194+
```
195+
196+
```php
197+
public function addRevisionsCustomFields($custom_fields) {
198+
$this->revisionsCustomFields = $custom_fields;
199+
}
200+
```
201+
202+
Now in your controller file, add fields like this
203+
(Example for User)
204+
```php
205+
$user->addRevisionsCustomFields([
206+
'action' => "Create"
207+
]);
208+
$user->save();
209+
```
210+
211+
188212
### Events
189213

190214
Every time a model revision is created an event is fired. You can listen for `revisionable.created`,

0 commit comments

Comments
 (0)