Skip to content

Commit f571a78

Browse files
authored
Respect $timestamps when updating model (#71)
1 parent fbb307e commit f571a78

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/NovaInlineRelationship.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,9 @@ protected function setModelAttributeValue(Model $model, $attribute, array $value
576576

577577
if (! array_key_exists($modelClass, static::$observedModels)) {
578578
$model::observe(NovaInlineRelationshipObserver::class);
579-
$model->updated_at = Carbon::now();
579+
if ($model->usesTimestamps()) {
580+
$model->updated_at = Carbon::now();
581+
}
580582
}
581583

582584
static::$observedModels[$modelClass][$attribute] = $this->isNullValue($value) ? null : $value;

0 commit comments

Comments
 (0)