spatie laravel activity log code example
Example 1: activity log spatie
activity()->log('Look mum, I logged something');
Example 2: spatie/laravel-activitylog display only changed data
protected static $logAttributes = [];
public static function boot()
{
parent::boot();
static::saving(function (Model $model) {
static::$logAttributes = array_keys($model->getDirty());
});
}