californiamountainsnake / json-response
The json-response object for uniformity of responses api
1.0.5
2020-05-23 15:26 UTC
Requires
- php: ^7.1
- ext-json: *
- illuminate/http: *
- psr/log: ^1.1
Requires (Dev)
- ext-dom: *
- phpunit/phpunit: ^7.0
README
A simple object for creating api responses.
Install:
Require this package with Composer
Install this package through Composer.
Edit your project's composer.json
file to require californiamountainsnake/json-response
:
{ "name": "yourproject/yourproject", "type": "project", "require": { "php": "^7.1", "californiamountainsnake/json-response": "*" } }
and run composer update
or
run this command in your command line:
composer require californiamountainsnake/json-response
Usage examples:
<?php use CaliforniaMountainSnake\JsonResponse\JsonResponse; return JsonResponse::error(['error_1', 'error_2', 'error_3'], JsonResponse::HTTP_BAD_REQUEST)->make();