The json-response object for uniformity of responses api

1.0.5 2020-05-23 15:26 UTC

This package is auto-updated.

Last update: 2023-11-23 22:55:48 UTC


Build Status

A simple object for creating api responses.


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


run this command in your command line:

composer require californiamountainsnake/json-response

Usage examples:

use CaliforniaMountainSnake\JsonResponse\JsonResponse;
return JsonResponse::error(['error_1', 'error_2', 'error_3'], JsonResponse::HTTP_BAD_REQUEST)->make();