Available endpoints:
GET /article/
GET /article/{id}/
GET /article/{id}/relationships/tag/
GET /article/{id}/relationships/creator/
POST /article/
{
"data": [
{
"type": "article",
"attributes": {
"title": "Sample title",
"body": "Sample body"
},
"relationships": {
"creator": {
"data": {
"id": "1",
"type": "user"
}
}
}
}
]
}
PATCH /article/{id}/
{
"data":
{
"type": "article",
"id": "{id}",
"attributes": {
"title": "Updated title",
"body": "Updated body"
}
}
}
DELETE /article/{id}/
GET /tag/
GET /tag/{id}/
GET /tag/{id}/relationships/article/
GET /user/
GET /user/{id}/
GET /administrator/user/
GET /administrator/user/{id}/
POST /administrator/user/
{
"data": [
{
"type": "user",
"attributes": {
"username": "stark 123",
"email": "nohponex+stark123@gmail.com",
"name": "Stark 123",
"status": 1,
"password": "1234"
}
}
]
}
PATCH /administrator/user/{id}/
{
"data": {
"type": "user",
"id": "{id}",
"attributes": {
"name": "New name"
}
}
}
DELETE /administrator/user/{id}/
Requirements:
To download dependencies
composer update
It is also recommended to install and configure Xdebug
To initialize the SQLite database schema and records (required to run only once). You can reuse the command to reset the data.
php ./tools/database.php
To start local web server at port 8004
execute using php build-in server
php -S localhost:8004 -t ./public/
You can access the article
collection using GET http://localhost:8004/article/
request.
You can also expose /public
to your web server, NOTE we are using an .htaccess
file to rewrite the urls.
To run all available tests (syntax check, unit and request tests)
composer test
/tests/phpunit/
directory using PHPUnit/tests/testphase/
directory using phramework/testphaseTo execute only testphase tests
composer testphase
To generate an overview for testphase tests execute
composer testphase-report
More about writing testphase tests at https://github.com/phramework/testphase
Lint code using PSR-2 coding style
composer lint
Read localsettings.example.php if you need to modify any of the settings localy, without committing the changes.