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), ]; } }