Download the PHP package mpokket/laravel-api-helper without Composer
On this page you can find all versions of the php package mpokket/laravel-api-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mpokket/laravel-api-helper
More information about mpokket/laravel-api-helper
Files in mpokket/laravel-api-helper
Package laravel-api-helper
Short Description A set of API tools for Laravel projects
License MIT
Informations about the package laravel-api-helper
Laravel API Helper
A set of API tools for Laravel projects.
Installation
Prerequisites
- PHP7.1+
- Laravel project
Install via composer to the Laravel project
- Run composer command
composer require mpokket/laravel-api-helper
- Register the Service Provider
In config/app.php
, add the service provider to $providers
array
APIHelperServiceProvider
APIHelperServiceProvider provides Mpokket\APIHelper\Annotations\Deprecation Annotation for your API methods which supports the following IETF RFCs,
- RFC8594 - The Sunset HTTP Header Field
- Internet Draft draft-dalal-deprecation-header-01 - The Deprecation HTTP Header Field
Usage
To add Sunset and Deprecation for your APIs, use the following annotations over the API method directly.
Annotation options
Example response header:
Example 1
Annotation
Example 2
Annotation
Response headers
Notes
- Deprecate header IETF proposal is currently in draft status
- PHPUnit tests are not done for testing deprecate middleware
Debug
On non-production environment, if there's any exception from the middleware, there will be a response header that points to the exception and line number. Use this while reporting issues along with your controller method annotation.
Support
If you require any support, kindly use GitHub issue tracker for this project.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
MIT