Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
anteriovieira committed Oct 19, 2015
1 parent f8785ba commit f7e1bb4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ $logs = Team::logs->with(['user'])->get();
<a name="featuring"></a>
## Featuring Log
You it can set custom messages for presentation of logs. These messages can be set for both the model as for specific fields.The dynamic part of the message can be done by targeted fields per dot segmented as`{objeto.field} or {objeto.objeto.field}`.
You it can set custom messages for presentation of logs. These messages can be set for both the model as for specific fields.The dynamic part of the message can be done by targeted fields per dot segmented as`{objeto.value.value} or {object.value|Default value} or {object.value||callbackMethod}`.
Set messages to the model
```php
Expand All @@ -185,14 +185,19 @@ use OwenIt\Auditing\Auditing;
class Team extends Auditing
{
//...
public static $logCustomMessage = '{user.name|Anonymous} {type} a team {elapsed_time}';
public static $logCustomMessage = '{user.name|Anonymous} {type} a team {elapsed_time}'; // with default value
public static $logCustomFields = [
'name' => 'The name was defined as {new.name}',
'name' => 'The name was defined as {new.name||getNewName}', // with callback method
'owner' => [
'updated' => '{new.owner} owns the team',
'created' => '{new.owner|No one} was defined as owner'
],
];
public function getNewName($log)
{
return $log->new['name'];
}
//...
}
```
Expand Down

0 comments on commit f7e1bb4

Please sign in to comment.