kars / json-response
Returns json format when this package gives value and data properties
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/kars/json-response
Requires
- php: >=5.3.0
- ext-json: *
- json-api-php/json-api: ^2.0
Requires (Dev)
- phpunit/phpunit: ^4.8 || ^5.0
This package is not auto-updated.
Last update: 2025-10-05 01:05:44 UTC
README
Returns json format when this package gives value and data properties
Installation
composer require kars/json-response
Use
require_once "vendor/autoload.php";
$test= [
'name' => 'mehmet',
'email' => 'mehmetcanak99@gmail.com',
];
new \Kars\JsonResponse\Response('ok', '', $test);
Params (required)
- success or ok - 200 http status
- unauthorized - 401 http status
- exception - 500 http status
Response
{
"status":"ok",
"data":
{
"name":"mehmet",
"email":"mehmetcanak99@gmail.com"
}
}