Updates the content of an existing comment by its ID.
| Permission | Description |
|---|---|
comments.update | Update your own comment |
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| comment-id | int | Yes | ID of the comment to update | 123 |
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| content | string | Yes | New content for the comment (max 255 characters) | "Updated comment!" |
{
"content": "Updated comment!"
}
Returns the updated comment resource.
{
"comment": { /* Comment Resource */ }
}
{
"comment": {
"id": 123,
"user_id": 456,
"commentable_type": "App\\Models\\Gyms\\Gym",
"commentable_id": 42,
"content": "Updated comment!",
"parent_comment_id": 10,
"created_at": "2025-01-01 00:00:00",
"updated_at": "2025-01-01 00:10:00"
}
}
For a full schema, see Comment Resource.
| Status | Description | Reference |
|---|---|---|
| 422 | Validation error | Validation error |
| 401 | Unauthorized | Authentication error |
| 403 | Forbidden (no permission) | Permission error |