Posts (Laravel Forum 6.x)

Posts

Endpoint paths are prefixed with the forum.router.prefix config value (/forum/api by default).

# Fetch recent

GET /post/recent

Returns: a collection of posts updated since forum.general.old_thread_threshold.

# Fetch unread

GET /post/unread

Returns: a collection of threads that are updated or unread for the authenticated user.

# Fetch

GET /post/{id:int}

Returns: the post specified by {id}.

# Update

PATCH /post/{id:int}

Updates the post specified by {id}. See parameter list below.

Parameters

NameTypeDescription
contentString (required)The post content

Returns: the updated post object if successful.

# Delete

DELETE /post/{id:int}

Deletes the post specified by {id}. See parameter list below.

Parameters

NameTypeDescriptionDefault
permadeleteBooleanForce hard-deletionAlways true if soft-deletion is disabled, otherwise false

Returns: the deleted post object if successful.

# Restore

POST /post/{id:int}/restore

Restores the soft-deleted post specified by {id}.

Returns: the restored post object if successful.

# Bulk delete

DELETE /bulk/post

Deletes a selection of one or more posts. Any posts not eligible for selection are left unchanged. See parameter list below.

Parameters

NameTypeDescriptionDefault
postsInteger array (required)IDs of posts to deleteN/A
permadeleteBooleanForce hard-deletionAlways true if soft-deletion is disabled, otherwise false

Returns: a “success” response if successful.

# Bulk restore

Post /bulk/post/restore

Restores a selection of one or more posts. Any posts not eligible for selection are left unchanged. See parameter list below.

Parameters

NameTypeDescription
postsInteger array (required)IDs of posts to restore

Returns: a “success” response if successful.