Download the PHP package vvinners/vapi without Composer
On this page you can find all versions of the php package vvinners/vapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vvinners/vapi
More information about vvinners/vapi
Files in vvinners/vapi
Package vapi
Short Description An enhanced version return response of API JSON. Aim to standardize the return api data format.
License MIT
Informations about the package vapi
VAPI - Standardize the format of API return
[IMPORTANT] V2 of VAPI has breaking changes, should remove msgcode.php from config folder and publish the config file
Table of Contents
- Contribution
- Installation
- Demo
- [V2] (#v2)
- License
Contribution
Contributions are what make such an amazing community and project. Learn, inspire, and create between each other. Any contributions you make are greatly appreciated.
Installation
Publish config file to app/config
Put this to config/app.php if the package is not auto discovered
Demo
The code above will convert the data to this JSON format and return in HTTP 200 status
the second parameter "OK" can be updated at the msgcode.php below is an example data of the file
V2
- able to customize the msg_code and msg column at return response
- update msgcode.php format
License
The MIT License (MIT)
Copyright (c) 2020 VVinners
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.