Download the PHP package pyskunov/laravel-api-response without Composer
On this page you can find all versions of the php package pyskunov/laravel-api-response. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package laravel-api-response
General
This package allows creating json responses in easy way.
In order to shorthand JsonResponse creation you can use:
JsonResponse::success // return JsonResponse JsonResponse::noContent // return JsonResponse, 204 status JsonResponse::publicError // throws PublicException JsonResponse::privateError // throws PublicException JsonResponse::error // return JsonResponse, not using Handler.php of laravel, just returning JSON.
JsonResponseMixin
JsonResponse functionality extended with class JsonResponseMixin.
Exceptions
- VisibilityException - parent of PublicException & PrivateException
- PublicException - can obtain printable $data property + has message
- PrivateException - cannot obtain printable $data property, has only message
How to
Extend Status Codes
- create a new class and extend StatusCodes.php
- add your own codes or override existing codes
- use your own class while throwing errors
Extend Mixins
- publish vendor
- create a new class
- write your macroses inside a new class
- use your class in config file laravel-api-response that was recently published
TODO
- Add more Status Codes
- Add prettier Docs
- Cover with basic tests
All versions of laravel-api-response with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.3|^8.0
The package pyskunov/laravel-api-response contains the following files
Loading the files please wait ....