jq/response

Response is an helper class which handles HTTP response, status codes and messages returned from different functions. Useful for unifiying API responses.

Maintainers

Package info

github.com/JunaidQadirB/Response

Homepage

pkg:composer/jq/response

Statistics

Installs: 12

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0 2020-12-06 16:36 UTC

This package is auto-updated.

Last update: 2026-03-07 03:52:18 UTC


README

Response is tiny PHP package which handles HTTP response, status codes and messages returned from different functions. Useful for unifiying API responses.

Installation

$ composer require jq/response

Laravel 5 Configuration

Add the following line to the providers array in app/config.php

JunaidQadir\Response\ResponseServiceProvider::class

And the the following line to the aliases array in app/config.php

'AjaxResponse' => JunaidQadir\Response\ResponseFacade::class

Standard PHP Usage

to return json in response of an AJAX request

$response     = new \JunaidQadir\Response\Response();
echo $response->json('success', 'Thank You');
exit;

Laravel5 Usage

echo AjaxResponse::json('success', 'Thank You');