API Resources and first endpoints

This commit is contained in:
2021-03-31 03:55:09 +01:00
parent 2bc07d8ca0
commit ddd79d38fe
23 changed files with 497 additions and 209 deletions

View File

@@ -103,11 +103,13 @@ class JSON
public function build($headers = [])
{
// Uses the same structure as model resources, for consistency when they aren't used.
$response = [
'status' => $this->getStatus(),
'message' => $this->getMessage(),
'type' => $this->getType(),
'response' => $this->getData()
'data' => $this->getData(),
'meta' => [
'status' => $this->getStatus(),
'message' => $this->getMessage(),
],
];
return response($response, $this->getCode(), $headers);