Skip to content

Commit 86ccf00

Browse files
committed
Format created_at and updated_at in SurveyResource
1 parent 5853288 commit 86ccf00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/Http/Resources/SurveyResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public function toArray($request)
2222
'slug' => $this->slug,
2323
'status' => $this->status !== 'draft',
2424
'description' => $this->description,
25-
'created_at' => $this->created_at,
26-
'updated_at' => $this->updated_at,
25+
'created_at' => (new \DateTime($this->created_at))->format('Y-m-d H:i:s'),
26+
'updated_at' => (new \DateTime($this->updated_at))->format('Y-m-d H:i:s'),
2727
'expire_date' => (new \DateTime($this->expire_date))->format('Y-m-d'),
2828
'questions' => SurveyQuestionResource::collection($this->questions)
2929
];

0 commit comments

Comments
 (0)