diff --git a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php index bf608ff104e9..c81014677bd2 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php +++ b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php @@ -744,7 +744,7 @@ public function getDates() { $defaults = [static::CREATED_AT, static::UPDATED_AT]; - return $this->timestamps ? array_merge($this->dates, $defaults) : $this->dates; + return $this->usesTimestamps() ? array_merge($this->dates, $defaults) : $this->dates; } /** diff --git a/src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php b/src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php index 5f537ec2b57f..ba640fe4b54d 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php +++ b/src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php @@ -20,7 +20,7 @@ trait HasTimestamps */ public function touch() { - if (! $this->timestamps) { + if (! $this->usesTimestamps()) { return false; } diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index f6d06f165e6b..bce8fda93273 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -568,7 +568,7 @@ protected function performUpdate(Builder $query) // First we need to create a fresh query instance and touch the creation and // update timestamp on the model which are maintained by us for developer // convenience. Then we will just continue saving the model instances. - if ($this->timestamps) { + if ($this->usesTimestamps()) { $this->updateTimestamps(); } @@ -626,7 +626,7 @@ protected function performInsert(Builder $query) // First we'll need to create a fresh query instance and touch the creation and // update timestamps on this model, which are maintained by us for developer // convenience. After, we will just continue saving these model instances. - if ($this->timestamps) { + if ($this->usesTimestamps()) { $this->updateTimestamps(); }