Skip to content
This repository was archived by the owner on Oct 29, 2025. It is now read-only.

Latest commit

History

64 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Documentation

Let's go

Composer

composer require kosmosx/response
require __DIR__ . '/vendor/autoload.php';
$response = new Kosmosx\Response\RestResponse();
$handler = Kosmosx\Response\Exceptions\Handler();
$handler->setExceptionHandler(); 

use it

$response = new Kosmosx\Response\RestResponse($content, $status, $headers); //constructor
$response = new Kosmosx\Response\Factory\FactoryResponse::success(); //factory
$response->withData(true); //add to json array with key 'data'

Example

$response->success()
->withData(['test' => true])
->withData(['test2' => false])
->withMessage('Microservice Lumen work')
->withState();
//response {
"data": {
"test": true,
"test2": false
},
"messages": "Microservice Lumen work",
"state": "OK"
}

en: documentation

it: documentazione


If you find a bug or want to contribute, write to developer@fabriziocafolla.com

Releases

Packages

Used by

Contributors

Languages