From 24049670201496605321472c2bfabebf40bd6fa8 Mon Sep 17 00:00:00 2001 From: Matt Inamdar Date: Mon, 10 Dec 2018 12:31:13 +0000 Subject: [PATCH] fixed page feedback date parsing bug --- app/Http/Resources/PageFeedbackResource.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Resources/PageFeedbackResource.php b/app/Http/Resources/PageFeedbackResource.php index feaa2f1a..5d9b00e0 100644 --- a/app/Http/Resources/PageFeedbackResource.php +++ b/app/Http/Resources/PageFeedbackResource.php @@ -22,9 +22,9 @@ public function toArray($request) 'name' => $this->name, 'email' => $this->email, 'phone' => $this->phone, - 'consented_at' => $this->consented_at->format(Carbon::ISO8601), - 'created_at' => $this->created_at->format(Carbon::ISO8601), - 'updated_at' => $this->updated_at->format(Carbon::ISO8601), + 'consented_at' => optional($this->consented_at)->format(Carbon::ISO8601), + 'created_at' => optional($this->created_at)->format(Carbon::ISO8601), + 'updated_at' => optional($this->updated_at)->format(Carbon::ISO8601), ]; } }