PUT /api/v1/comments/{comment-id}
Updates the content of an existing comment by its ID.
Permissions
Permission | Description |
---|
comments.update | Update your own comment |
Path Parameters
Name | Type | Required | Description | Example |
---|
comment-id | int | Yes | ID of the comment to update | 123 |
Request Body Parameters
Name | Type | Required | Description | Example |
---|
content | string | Yes | New content for the comment (max 255 characters) | "Updated comment!" |
Request Example
{
"content": "Updated comment!"
}
Response
200 OK
Returns the updated comment resource.
Schema
{
"comment": { /* Comment Resource */ }
}
Example
{
"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.
Error Responses