REST API for blog

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rerum, provident, itaque. Atque minima sapiente maiores voluptatibus, voluptatem incidunt sed eos. Molestiae odit deserunt ipsa iste, repellat saepe mollitia veniam nisi ipsum rem architecto commodi, nesciunt est, voluptas quas minima facilis sequi doloremque itaque. At libero, quibusdam minima nihil. Velit explicabo eos debitis sapiente, voluptas quaerat molestiae placeat inventore aperiam repudiandae quos fugit quis ipsam quae nisi! Laboriosam repellat molestias nisi, vel id, atque, modi magnam eos reiciendis asperiores mollitia veniam labore. Est unde, temporibus esse sapiente excepturi culpa cumque natus quas sit enim, voluptates deserunt eaque quam tenetur facere consequatur.

REST API for blog

Type: GET

URL: http://rest.nasirkhan.me/api/posts

Type: GET

URL: http://rest.nasirkhan.me/api/posts/{id}

Example: http://rest.nasirkhan.me/api/posts/10

Type: GET

URL: http://rest.nasirkhan.me/api/posts/{post-id}/categories

Example: http://rest.nasirkhan.me/api/posts/12/categories

Type: GET

URL: http://rest.nasirkhan.me/api/posts/{post-id}/comments

Example: http://rest.nasirkhan.me/api/posts/12/comments

Type: GET

URL: http://rest.nasirkhan.me/api/categories

Type: GET

URL: http://rest.nasirkhan.me/api/categories/{id}

Example: http://rest.nasirkhan.me/api/categories/12

Type: GET

URL: http://rest.nasirkhan.me/api/categories/{id}/posts

Example: http://rest.nasirkhan.me/api/categories/12/posts

Post Table
Columns Name
  • Title
  • Body
  • Description
  • Tag
Many to Many relation with Category
One to Many relation with Comment
All posts Single post
Category_Post Table(pivot)
Columns Name
  • category_id
  • post_id
All categories of post id = 10 All posts of category id = 10
Category Table
Columns Name
  • Name
  • Description
Many to Many relation with Post
All categories Single category
Comments Table
Columns Name
  • post_id
  • Name
  • Comment
Belongs-to relation with Post
All Comments of post id = 10