Skip to content

Commit 6403bd8

Browse files
Add BSON UTCDateTime serialization
1 parent 678709b commit 6403bd8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Eloquent/Model.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ public function attributesToArray()
333333
$value = (string) $value;
334334
} elseif ($value instanceof Binary) {
335335
$value = (string) $value->getData();
336+
} elseif ($value instanceof UTCDateTime) {
337+
$value = $this->serializeDate($value->toDateTime());
336338
} elseif (is_array($value)) {
337339
foreach ($value as &$embedValue) {
338340
$convertMongoObjects($embedValue);

0 commit comments

Comments
 (0)