$this->id, 'evaluation_campaign_id' => $this->evaluation_campaign_id, 'user_id' => $this->user_id, 'user' => $this->whenLoaded('user', fn() => new UserResource($this->user)), 'user_name' => $this->whenLoaded('user', fn() => $this->user->name), 'source' => $this->whenLoaded('user', fn() => $this->user->type), 'rating' => (int) $this->rating, 'comment' => $this->comment, 'created_at' => Carbon::parse($this->created_at)->format('Y-m-d H:i:s'), 'updated_at' => Carbon::parse($this->updated_at)->format('Y-m-d H:i:s'), ]; } }