Download the PHP package jornatf/laravel-api-json-response without Composer
On this page you can find all versions of the php package jornatf/laravel-api-json-response. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-api-json-response
Laravel API Json Response
A Laravel Package that returns a JSON Response for APIs. In some methods, you can return cool Json response for your API.
If you like this package you can Buy me a Coffee ☕️
Installation
Via composer:
Usage
Example 1:
This example shows you how to use the basic required methods.
Success response:
Error response:
Exemple 2:
This example shows you how to use a method to find a model and return a JSON Reponse in a single line of code.
If model found:
Else:
Documentation
Available methods:
Available status code:
Status code | Response type | Default message |
---|---|---|
200 |
success |
Ok Model Found |
201 |
success |
Created |
202 |
success |
Accepted |
400 |
error |
Bad Request |
401 |
error |
Unauthorized |
403 |
error |
Forbidden |
404 |
error |
Not Found Model Not Found |
405 |
error |
Method Not Allowed |
408 |
error |
Request Timeout |
429 |
error |
Too Many Requests |
500 |
error |
Internal Server Error |
502 |
error |
Bad Gateway |
503 |
error |
Service Unavailable |
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Feel free to contribute to this project to improve with new features or fix bugs 👍
Credits
- Jordan
- All Contributors
License
The MIT License (MIT).
Please see License File for more information.