Package Data | |
---|---|
Maintainer Username: | MarcinOrlowski |
Package Create Date: | 2016-04-11 |
Package Last Update: | 2024-06-25 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-17 03:02:38 |
Package Statistics | |
---|---|
Total Downloads: | 320,315 |
Monthly Downloads: | 7,699 |
Daily Downloads: | 83 |
Total Stars: | 721 |
Total Watchers: | 17 |
Total Forks: | 80 |
Total Open Issues: | 7 |
Upgrading from previous version? Ensure you read compatibility docs prior altering your composer.json
!
ResponseBuilder
is Laravel's helper designed to simplify building
nice, normalized and easy to consume REST API responses.
Conclude your controller method with simple
return ResponseBuilder::success();
and your client will get nice JSON like
{
"success": true,
"code": 0,
"locale": "en",
"message": "OK",
"data": null
}
Something went wrong? Just do
return ResponseBuilder::error(250);
and the following JSON response will be returned
{
"success": false,
"code": 250,
"locale": "en",
"message": "Your error message for code 250",
"data": null
}
Nice and easy! And yes, message
can be easily customized! Also there're much, much more you can do with
rich ResponseBuilder
's API. See library documentation for details and usage examples!
Please report any issue spotted using GitHub's project tracker.
If you'd like to contribute to the this project, please open new ticket before doing any work. This will help us save your time in case I'd not be accept PR either completely or in proposed form. But if all is good and clear then follow common routine: