An open API service indexing awesome lists of open source software.

https://github.com/code-architect/json-responser-package


https://github.com/code-architect/json-responser-package

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

          

#json-responser-package
Take the value user assign/enter to the properties of the class. And return the json formatted response.

## Installation
composer require codearchitect/json_response

### Usage
```php
require_once "vendor/autoload.php";

$test= [
'name' => 'code-architect',
'task' => 'developer',
'email' => 'email@xyz.com',
'tech' => ['php', 'mysql', 'mongodb', 'elastic-search']
];

new \CodeArchitect\ResponseClass\JsonResponse('ok', '', $test);
```

### Param 1 (required)
1. success or ok - 200 http status
2. unauthorized - 401 http status
3. exception - 500 http status

### Param 2 (optional)
string - the return message, use empty quote if message is not available

### Param 3 (required)
array - data array