Created
January 30, 2017 16:40
-
-
Save joetannenbaum/59415584e7fb867bbd7080cd9affe064 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyModelObserver | |
{ | |
use TracksHistoryTrait; | |
public function updated(MyModel $model) | |
{ | |
$this->track($model); | |
// or | |
$this->track($model, function ($value, $field) { | |
if ($field === 'total') { | |
$value /= 100; | |
} | |
return [ | |
'body' => "Updated {$field} to ${value}", | |
]; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can you help me
file path i should deploy like in model and other how some good step u can guide me ?