resource_index.md 4.7 KB


title: API Reference

language_tabs:

  • bash
  • javascript

includes:

search: true

toc_footers:

Welcome to the generated API reference. Get Postman Collection

#general

Display a listing of the resource.

Example request:

curl -X GET -G "http://localhost/api/users" \
    -H "Accept: application/json"
const url = new URL("http://localhost/api/users");

let headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "index_resource": true
}

HTTP Request

GET api/users

Show the form for creating a new resource.

Example request:

curl -X GET -G "http://localhost/api/users/create" \
    -H "Accept: application/json"
const url = new URL("http://localhost/api/users/create");

let headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "create_resource": true
}

HTTP Request

GET api/users/create

Store a newly created resource in storage.

Example request:

curl -X POST "http://localhost/api/users" \
    -H "Accept: application/json"
const url = new URL("http://localhost/api/users");

let headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/users

Display the specified resource.

Example request:

curl -X GET -G "http://localhost/api/users/1" \
    -H "Accept: application/json"
const url = new URL("http://localhost/api/users/1");

let headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "show_resource": true
}

HTTP Request

GET api/users/{user}

Show the form for editing the specified resource.

Example request:

curl -X GET -G "http://localhost/api/users/1/edit" \
    -H "Accept: application/json"
const url = new URL("http://localhost/api/users/1/edit");

let headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "edit_resource": true
}

HTTP Request

GET api/users/{user}/edit

Update the specified resource in storage.

Example request:

curl -X PUT "http://localhost/api/users/1" \
    -H "Accept: application/json"
const url = new URL("http://localhost/api/users/1");

let headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "PUT",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

PUT api/users/{user}

PATCH api/users/{user}

Remove the specified resource from storage.

Example request:

curl -X DELETE "http://localhost/api/users/1" \
    -H "Accept: application/json"
const url = new URL("http://localhost/api/users/1");

let headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

DELETE api/users/{user}