resource_index.md 4.6 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 "http://localhost/api/user" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/user",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "index_resource": true
}

HTTP Request

GET api/user

Show the form for creating a new resource.

Example request:

curl -X GET "http://localhost/api/user/create" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/user/create",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "create_resource": true
}

HTTP Request

GET api/user/create

Store a newly created resource in storage.

Example request:

curl -X POST "http://localhost/api/user" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/user",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/user

Display the specified resource.

Example request:

curl -X GET "http://localhost/api/user/{user}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/user/{user}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "show_resource": "1"
}

HTTP Request

GET api/user/{user}

Show the form for editing the specified resource.

Example request:

curl -X GET "http://localhost/api/user/{user}/edit" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/user/{user}/edit",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "edit_resource": "1"
}

HTTP Request

GET api/user/{user}/edit

Update the specified resource in storage.

Example request:

curl -X PUT "http://localhost/api/user/{user}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/user/{user}",
    "method": "PUT",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

PUT api/user/{user}

PATCH api/user/{user}

Remove the specified resource from storage.

Example request:

curl -X DELETE "http://localhost/api/user/{user}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/user/{user}",
    "method": "DELETE",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

DELETE api/user/{user}