Web API sederhana untuk CRUD data desa. dibuat dengan Laravel
git clone https://github.com/ahmaruff/memento-mori
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate
php artisan laravolt:indonesia:seed
php artisan serve
Method | Path | Params | Body | Desc |
---|---|---|---|---|
GET |
/api/desa |
?page={page_number} | n/a | Return all data desa |
GET |
/api/desa/{id} |
n/a | n/a | Return single data desa |
POST |
/api/desa |
n/a | code, district_code, name, lat, long, pos | Insert new data desa |
PUT |
/api/desa/{id} |
n/a | code, district_code, name, lat, long, pos | Update data desa |
DELETE |
/api/desa/{id} |
n/a | n/a | Delete single data desa |
All responses should be in JSON format. following JSend Standard. The HTTP code will be 400 (Bad Request) for all errors unless stated otherwise.
{
"status" : "success|fail|error",
"code" : "HTTP_STATUS_CODE",
"message" : "custom message",
"data" : {
"data" : "data goes here"
}
}
Ahmad Ma'ruf © 2024