ReturnValue is an helper class to handle return values, status codes and messages returned from different functions.
$ composer require jeykeu/returnvalue
to return json in response of an AJAX request
$response = new \Response\Response();
echo $response->json('success', 'Thank You');
exit;