(int)$model->id, "body" => $model->body, "note_id" => $model->note_id, "comment_count" => $model->comment_count, "good_count" => $model->good_count, "user_id" => $model->user_id, "user" => $model->user, 'is_answer' => $model->is_answer, "comments" => Comment::query()->where('parent_id', $model->id)->with(['user'])->orderByDesc('id')->get(), 'created_at' => $model->created_at->format(Carbon::DEFAULT_TO_STRING_FORMAT), 'updated_at' => $model->updated_at->format(Carbon::DEFAULT_TO_STRING_FORMAT) ]; } }