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: 2024-11-24 01:07:45 UTC


README

Build Status

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();