Skip to content

aihsanbozaci/Laravel-REST_API

Repository files navigation

Laravel REST API - CRUD

Technologies Used

  • PHP
  • Composer
  • Laravel
  • Postman
  • MySQL

Prepared Requests

Show All Posts:

You can make a request to http://localhost:8000/api/posts using the GET method with Postman or just use that URL.


Show a User Posts:

You can make a request to http://localhost:8000/api/users/{user_id}/posts using the GET method with Postman or just use that URL.


Add Post:

You can make a request to http://localhost:8000/api/posts using the POST method with Postman. Sample data:

[

    {
        "title": "New Post 1",
        "content": "newPost-1",
        "user_id": 2
    },
    {
        "title": "New Post 2",
        "content": "newPost-2",
        "user_id":3
    }
]

Update Post

You can make a request to http://localhost:8000/api/posts/{post_id} using the PUT method with Postman. Sample data:

{
    "title": "Updated Post",
    "content": "It is a updated post.",
    "user_id": 1
}

Delete Post

You can make a request to http://localhost:8000/api/posts/{post_id}/ using the DELETE method with Postman or just use that URL.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors