Simple package for returning standard json responses for Laravel Framework.
composer require soltancode/return-response
use Soltancode\ReturnResponse\Facades\ReturnResponse;
// $httpResponse = 200;
// $data = ['success' => true];
// $message = "Operation done successfully.";
# Using as class:
return ReturnResponse::response($httpResponse, $data, $message);
# Using as helper:
return returnResponse()->response($httpResponse, $data, $message);
{
"status_code": 200,
"message": "Operation done successfully.",
"count": 1,
"data": {
"success": true
}
}
SendRequest - PHP cURL class that makes it easy to send HTTP requests and integrate with web APIs.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.