Download the PHP package broken-titan/laravel-idempotency-middleware without Composer
On this page you can find all versions of the php package broken-titan/laravel-idempotency-middleware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download broken-titan/laravel-idempotency-middleware
More information about broken-titan/laravel-idempotency-middleware
Files in broken-titan/laravel-idempotency-middleware
Package laravel-idempotency-middleware
Short Description Idempotency middleware for Laravel.
License MIT
Informations about the package laravel-idempotency-middleware
Laravel Idempotent Middleware
This package makes it easy to add an indempotentcy to Laravel requests.
Contents
- Installation
- Configuration
- Usage
- Testing
- Security
- Contributing
- Credits
- License
Installation
Install this package with Composer:
composer require broken-titan/laravel-idempotency-middleware
Configuration
There are three configuration values in use which all have defaults. They can be overwritten in config/idempotency.php.
- idempotency.expiration (default: 1440)
- idempotency.header (default: "Idempotency-Key")
- idempotency.methods (default: ["POST"])
You can also pass route-specific parameters in the routes file when setting the middleware.
Usage
For ease of use, it is recommended that you add the middleware in your App\Http\Kernel.php file to $routeMiddleware.
You can set middleware for routes using the standard middleware assignment function.
The idempotency middle parameters can be set on a per-route basis, overriding the configuration default.
Testing
A Docker compose file is included that allows you to run tests for this package.
Security
If you discover any security issues that would affect existing users, please email [email protected] instead of using the issue tracker.
Contributing
Feel free to contribute to the package.
License
The MIT License (MIT). Please see License File for more information.