Download the PHP package aelnemr/api-response without Composer
On this page you can find all versions of the php package aelnemr/api-response. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download aelnemr/api-response
More information about aelnemr/api-response
Files in aelnemr/api-response
Download aelnemr/api-response
More information about aelnemr/api-response
Files in aelnemr/api-response
Vendor aelnemr
Package api-response
Short Description This package will handle restful api response
License MIT
Package api-response
Short Description This package will handle restful api response
License MIT
Please rate this library. Is it a good library?
Informations about the package api-response
CoreJsonResponse
CoreJsonResponse JSON response trait. This trait makes it easy for any controller to return a JSON response with the appropriate HTTP status code.
Install via composer :fire:
Usage
All that you need is to use
the CoreJsonResponse
trait inside your controller.
Example:
Available methods
Success Methods :v:
Method | Status code | Description |
---|---|---|
ok | 200 | Successful get, patch (return a JSON object) |
okWithPagination | 200 | Successful get, patch (return a JSON object) |
created | 201 | Successful post (return a JSON object) |
Error Status :shit:
Method | Status code | Description |
---|---|---|
unauthenticated | 401 | Error Not authenticated |
forbidden | 403 | Error Not authorized (Authenticated, but no permissions) |
notFound | 404 | Error Not Found |
invalidRequest | 422 | Error Validation |
Extra methods :man:
Method | Status code | Description |
---|---|---|
accepted | 202 | Successful post, delete, path - async |
badRequest | 400 | Error The request could not be understood by the server due to malformed syntax |
paymentRequired | 402 | Error Payment required |
conflict | 409 | Error Logical error |
All versions of api-response with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.1.0
The package aelnemr/api-response contains the following files
Loading the files please wait ....