Laravel Forum 4.x Documentation

API - Posts

Posts

Index

GET <root>/api/post

Returns a collection of posts, optionally narrowed down by thread_id.

Store

POST <root>/api/post

Creates a post with the given attributes. Valid attributes are:

NameTypeDescriptionDefault
thread_idInteger (required)Parent thread IDN/A
post_idIntegerParent post ID0
author_idInteger (required)Author’s user IDN/A
contentInteger (required)Post contentN/A

Fetch

GET <root>/api/post/<id>

Returns a specified post.

Delete

DELETE <root>/api/post/<id>

Deletes a specified post.

Restore

PATCH <root>/api/post/<id>/restore

Restores the specified post (if it exists and has been soft-deleted).

Update

PATCH <root>/api/post/<id>

Updates the specified post with the given attributes (post_id, author_id, content).