From 0565141f3776df9010325772292feea8dc2c2506 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 29 Dec 2019 14:18:46 +0100 Subject: [PATCH] datetime is jsonserializable, didn't know that :) --- Models/NewsArticle.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Models/NewsArticle.php b/Models/NewsArticle.php index f19739f..0a1a195 100644 --- a/Models/NewsArticle.php +++ b/Models/NewsArticle.php @@ -433,15 +433,15 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable public function toArray() : array { return [ - 'id' => $this->id, - 'title' => $this->title, - 'plain' => $this->plain, - 'content' => $this->content, - 'type' => $this->type, - 'status' => $this->status, - 'featured' => $this->featured, - 'publish' => $this->publish->format('Y-m-d H:i:s'), - 'createdAt' => $this->createdAt->format('Y-m-d H:i:s'), + 'id' => $this->id, + 'title' => $this->title, + 'plain' => $this->plain, + 'content' => $this->content, + 'type' => $this->type, + 'status' => $this->status, + 'featured' => $this->featured, + 'publish' => $this->publish, + 'createdAt' => $this->createdAt, 'createdBy' => $this->createdBy, ]; }