Download the PHP package mpstr24/laravel-api-responses without Composer
On this page you can find all versions of the php package mpstr24/laravel-api-responses. 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-responses
Laravel API Responses
This package provides API response functions via a trait to help improve consistency of API response codes across your projects.
Features
- Pre-made functions of the most common API responses.
Installation
Install the package via Composer:
Usage/Examples
First add the trait to your controller.
All methods, except from "No Content" allow for a message and data to be returned. Custom messages also allow you to choose the status code.
Examples of each below.
Success - 200
Created - 201
Accepted - 202
No Content - 204
Bad Request - 400
Unauthorized - 401
Forbidden - 403
Not Found - 404
Teapot - 418
Unprocessable - 422
Too Many Requests - 429
Server Error - 500
Custom response
Roadmap
- [ ] Support for resources
- [ ] Expand into more helpful API features
- [x] Larastan goals
- [x] 5
- [x] 6
- [x] 7
- [x] 8
- [x] 9
License
All versions of laravel-api-responses with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.0
The package mpstr24/laravel-api-responses contains the following files
Loading the files please wait ...