From 70993589858513905c4ec4cc7e14d2ed4a9c57e2 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 19 Jun 2024 11:11:50 +0100 Subject: [PATCH] Added accessor/mutator Signed-off-by: snipe --- app/Models/Asset.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 5b3d6128ec..dbcd71462d 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -984,6 +984,14 @@ class Asset extends Depreciable ); } + protected function lastAuditDate(): Attribute + { + return Attribute::make( + get: fn ($value) => $value ? Carbon::parse($value)->format('Y-m-d H:i:s') : null, + set: fn ($value) => $value ? Carbon::parse($value)->format('Y-m-d H:i:s') : null, + ); + } + protected function lastCheckout(): Attribute { return Attribute::make(