Download the PHP package larowka/prevent-duplicate-requests without Composer
On this page you can find all versions of the php package larowka/prevent-duplicate-requests. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download larowka/prevent-duplicate-requests
More information about larowka/prevent-duplicate-requests
Files in larowka/prevent-duplicate-requests
Package prevent-duplicate-requests
Short Description Prevent duplicate requests middleware for Laravel applications.
License MIT
Homepage https://github.com/larowka/prevent-duplicate-requests
Informations about the package prevent-duplicate-requests
Prevent Duplicate Requests Middleware for Laravel
Middleware for Laravel that prevents duplicate requests based on user actions.
This middleware is designed to manage and prevent duplicate requests within a specified timeframe, ensuring that only unique requests are processed.
- Prevent Duplicate Requests Middleware for Laravel
- Installation
- Usage
- Laravel 11
- Global Middleware
- Assigning Middleware to Routes
- Middleware Aliases
- Laravel 10
- Laravel 11
- Features
- Testing
- Changelog
- Contributing
- Security
- Credits
- License
Installation
You can install the package via Composer:
Usage
Laravel 11
Global Middleware
To apply middleware globally to every HTTP request in Laravel 11, you can use the withMiddleware method in your bootstrap/app.php file:
Assigning Middleware to Routes
If you want to assign middleware to specific routes, use the middleware method when defining the route:
Middleware Aliases
You can define aliases for middleware in your bootstrap/app.php file to use shorter names for middleware classes:
Once defined, you can use the alias when assigning middleware to routes:
Laravel 10
Add the middleware to your Laravel application's HTTP kernel:
Apply the middleware to your routes:
Or use globally:
Features
- Prevents Duplicate Requests: Blocks duplicate requests within a specified timeframe.
- Flexible Configuration: Customize the duration for which requests are cached.
- Supports Authenticated Users: Differentiates between authenticated and unauthenticated users.
- Idempotency Support: Ensures idempotent actions are enforced for user-specific operations.
Testing
Run the tests using PHPUnit:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security issues, please email [email protected] instead of using the issue tracker.
Credits
- Serj Toropilin
- All Contributors
License
The MIT License (MIT). Please see LICENSE for more information.
All versions of prevent-duplicate-requests with dependencies
illuminate/http Version ^10.0|^11.0
illuminate/support Version ^10.0|^11.0