Skip to content

Commit

Permalink
Respect $timestamps when updating model (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
genesiscz authored Jan 17, 2024
1 parent fbb307e commit f571a78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/NovaInlineRelationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,9 @@ protected function setModelAttributeValue(Model $model, $attribute, array $value

if (! array_key_exists($modelClass, static::$observedModels)) {
$model::observe(NovaInlineRelationshipObserver::class);
$model->updated_at = Carbon::now();
if ($model->usesTimestamps()) {
$model->updated_at = Carbon::now();
}
}

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

0 comments on commit f571a78

Please sign in to comment.