Download the PHP package djurovicigoor/larajsonresponse without Composer
On this page you can find all versions of the php package djurovicigoor/larajsonresponse. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download djurovicigoor/larajsonresponse
More information about djurovicigoor/larajsonresponse
Files in djurovicigoor/larajsonresponse
Package larajsonresponse
Short Description Laravel API wrapper for returning JSON response.
License MIT
Homepage https://github.com/djurovicigoor/larajsonresponse
Informations about the package larajsonresponse
LaraJsonResponse
Laravel API wrapper for returning JSON response.
Installation
Via Composer
Usage
The base method is laraResponse();
JSON response of this method will be:
If you want to return success JSON response with data and status code 200, you have to use laraResponse($message , $data)->success()
JSON response of this method will be:
If you want to return error JSON response with message, ERROR and status code 400, you have to use laraResponse($message , NULL , $error)->error()
JSON response of this method will be:
If you want to return unauthorized JSON response response with 401 status code, you have to use laraResponse($message)->unAuthorized()
JSON response of this method will be:
If you want to return forbidden JSON response response with 403 status code, you have to use laraResponse($message)->forbidden()
JSON response of this method will be:
If you want to return not found JSON response with 404 status code , you have to use laraResponse($message)->notFound()
JSON response of this method will be:
And finaly you can use laraResponse($message)->customCode($yourCustomCode) to return JSON response with yout custom code;
JSON response of this method will be:
Change log
Please see the changelog for more information on what has changed recently.
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Donate
If you found this project helpful or you learned something from the source code and want to appreciate
Credits
License
MIT. Please see the license file for more information.