Response is tiny PHP package which handles HTTP response, status codes and messages returned from different functions. Useful for unifiying API responses.
$ composer require jq/response
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
to return json in response of an AJAX request
$response = new \JunaidQadir\Response\Response();
echo $response->json('success', 'Thank You');
exit;
echo AjaxResponse::json('success', 'Thank You');