Skip to content

Commit

Permalink
[9.x] Make HasTimestamps::updateTimestamps chainable (#42533)
Browse files Browse the repository at this point in the history
* Make `HasTimestamps::updateTimestamps` chainable

* Fix style
  • Loading branch information
leandro-hermes authored May 26, 2022
1 parent 6d5377b commit 6999399
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function touch($attribute = null)
/**
* Update the creation and update timestamps.
*
* @return void
* @return $this
*/
public function updateTimestamps()
{
Expand All @@ -56,6 +56,8 @@ public function updateTimestamps()
if (! $this->exists && ! is_null($createdAtColumn) && ! $this->isDirty($createdAtColumn)) {
$this->setCreatedAt($time);
}

return $this;
}

/**
Expand Down

0 comments on commit 6999399

Please sign in to comment.