Skip to content

Commit

Permalink
Better usage example.
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdeeptarat committed May 22, 2016
1 parent 27ce5f3 commit 14a0de1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,20 @@ Use the ```config/timetraveller.php``` file to modify the package defaults.

## Usage
Enable time traveller on a model by using the trait.

```php
class Post extents Model
{
use TimeTravel;

public function getBy()
{
return Auth::user()->name;
}
}
```

All models that use the trait must implement ```abstract public function by()``` which returns any string.
All models that use the trait must implement ```abstract public function getBy()``` which returns any string.
This function can be used to save any additional attributes such as the owner of the change.

###Get the state of a record at a specific data/time.
Expand Down

0 comments on commit 14a0de1

Please sign in to comment.