From 79c2c3862f0a37f6dcdf1c4fcb0427a4a0b7ed14 Mon Sep 17 00:00:00 2001 From: Zing Date: Mon, 9 Dec 2019 21:53:22 +0800 Subject: [PATCH] add method to get qualified timestamps column (#30792) --- .../Eloquent/Concerns/HasTimestamps.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php b/src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php index 3f0fa4e26326..8de099c998cd 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php +++ b/src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php @@ -126,4 +126,24 @@ public function getUpdatedAtColumn() { return static::UPDATED_AT; } + + /** + * Get the fully qualified "created at" column. + * + * @return string + */ + public function getQualifiedCreatedAtColumn() + { + return $this->qualifyColumn($this->getCreatedAtColumn()); + } + + /** + * Get the fully qualified "updated at" column. + * + * @return string + */ + public function getQualifiedUpdatedAtColumn() + { + return $this->qualifyColumn($this->getUpdatedAtColumn()); + } }