From e0e557a4dc944f35663e22f00c92326e549da912 Mon Sep 17 00:00:00 2001 From: Dena Date: Mon, 4 Apr 2022 22:09:36 +0430 Subject: [PATCH] Update IranPaymentTransaction.php date serialization format updated --- src/Models/IranPaymentTransaction.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Models/IranPaymentTransaction.php b/src/Models/IranPaymentTransaction.php index f95daf8..2404f95 100644 --- a/src/Models/IranPaymentTransaction.php +++ b/src/Models/IranPaymentTransaction.php @@ -2,6 +2,7 @@ namespace Dena\IranPayment\Models; +use DateTimeInterface; use Illuminate\Database\Eloquent\Model; use Dena\IranPayment\Traits\IranPaymentDatabase as DatabaseTrait; @@ -34,6 +35,17 @@ class IranPaymentTransaction extends Model const T_PAID_BACK = 5; const T_CANCELED = 6; + /** + * Prepare a date for array / JSON serialization. + * + * @param \DateTimeInterface $date + * @return string + */ + protected function serializeDate(DateTimeInterface $date) + { + return $date->format('Y-m-d H:i:s'); + } + /** * The attributes that are mass assignable. *