You can also hook in the updating/creating/saving etc events, and use getDirty() on the model to get the changes.
self::updating(function($model)
{
$changes = array();
foreach($model->getDirty() as $key => $value){
$original = $model->getOriginal($key);
$changes[$key] = [
'old' => $original,
'new' => $value,
];
}
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community