$this->id, 'title' => $this->title, 'description' => $this->description, 'status' => $this->status, 'priority' => $this->priority, 'due_at' => $this->due_at?->toIso8601String(), 'started_at' => $this->started_at?->toIso8601String(), 'completed_at' => $this->completed_at?->toIso8601String(), 'estimated_hours' => $this->estimated_hours, 'actual_hours' => $this->actual_hours, 'project_id' => $this->project_id, 'comment_count' => $this->whenLoaded('comments', fn () => $this->comments->count()), 'project' => $this->whenLoaded('project', fn () => [ 'id' => $this->project->id, 'name' => $this->project->name, ]), 'comments' => $this->whenLoaded('comments', fn () => TaskCommentResource::collection($this->comments)), 'created_at' => $this->created_at->toIso8601String(), 'updated_at' => $this->updated_at->toIso8601String(), 'deleted_at' => $this->deleted_at?->toIso8601String(), ]; } }