Files
scribe/tests/Fixtures/resource_index.md
2018-10-11 15:13:53 +01:00

4.6 KiB

title, language_tabs, includes, search, toc_footers
title language_tabs includes search toc_footers
API Reference
bash
javascript
true
<a href='http://github.com/mpociot/documentarian'>Documentation Powered by Documentarian</a>

Info

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"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/users",
    "method": "GET",
    "headers": {
        "accept": "application/json",
    }
}

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

Example response:

{
    "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"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/users/create",
    "method": "GET",
    "headers": {
        "accept": "application/json",
    }
}

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

Example response:

{
    "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"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/users",
    "method": "POST",
    "headers": {
        "accept": "application/json",
    }
}

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

HTTP Request

POST api/users

Display the specified resource.

Example request:

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

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

Example response:

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

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

Example response:

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

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

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

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

HTTP Request

DELETE api/users/{user}