Skip to content

Instantly share code, notes, and snippets.

@joetannenbaum
Created January 30, 2017 16:40
Show Gist options
  • Save joetannenbaum/59415584e7fb867bbd7080cd9affe064 to your computer and use it in GitHub Desktop.
Save joetannenbaum/59415584e7fb867bbd7080cd9affe064 to your computer and use it in GitHub Desktop.
<?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}",
];
});
}
}
@perfectwebtech
Copy link

can you help me

file path i should deploy like in model and other how some good step u can guide me ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment