From 6a3be3301ef9baa4ddc02684084fe792d9bec319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8?= Date: Tue, 22 Oct 2024 20:53:43 +0800 Subject: [PATCH] fix(messages): timezone is missing from datetime (#4086) --- extensions/messages/src/Dialog.php | 4 ++++ extensions/messages/src/UserDialogState.php | 1 + 2 files changed, 5 insertions(+) diff --git a/extensions/messages/src/Dialog.php b/extensions/messages/src/Dialog.php index c8b95c82a..7e15315d9 100644 --- a/extensions/messages/src/Dialog.php +++ b/extensions/messages/src/Dialog.php @@ -42,6 +42,10 @@ class Dialog extends AbstractModel protected $table = 'dialogs'; + protected $casts = [ + 'last_message_at' => 'datetime' + ]; + public $timestamps = true; public static array $types = ['direct']; diff --git a/extensions/messages/src/UserDialogState.php b/extensions/messages/src/UserDialogState.php index b684ab788..d5016146f 100644 --- a/extensions/messages/src/UserDialogState.php +++ b/extensions/messages/src/UserDialogState.php @@ -36,6 +36,7 @@ class UserDialogState extends AbstractModel 'user_id' => 'integer', 'dialog_id' => 'integer', 'joined_at' => 'datetime', + 'last_read_at' => 'datetime', 'last_read_message_id' => 'integer' ];