https://github.com/m1guelpf/laravel-etag
A Laravel ratelimiter that supports ETag headers
https://github.com/m1guelpf/laravel-etag
etag laravel middleware package rate-limit ratelimit
Last synced: 2 months ago
JSON representation
A Laravel ratelimiter that supports ETag headers
- Host: GitHub
- URL: https://github.com/m1guelpf/laravel-etag
- Owner: m1guelpf
- License: mit
- Created: 2018-04-11T14:23:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-16T18:36:01.000Z (almost 6 years ago)
- Last Synced: 2025-03-30T21:46:46.757Z (6 months ago)
- Topics: etag, laravel, middleware, package, rate-limit, ratelimit
- Language: PHP
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A Laravel ratelimiter that supports ETag
[](https://packagist.org/packages/m1guelpf/laravel-etag)
[](https://packagist.org/packages/m1guelpf/laravel-etag)## Installation
You can install the package via composer:
```bash
composer require m1guelpf/laravel-etag
```To use it, you must replace the throttle middleware in your Http Kernel file with `\M1guelpf\Etag\EtagMiddleware::class`:
```php
// app/Http/Kernel.php...
protected $routeMiddleware = [
...
'throttle' => \M1guelpf\Etag\EtagMiddleware::class,
];
```## Usage
To throttle a route while respecting ETag headers, just add the throttle middleware like you'd do without the package:
```php
// in a routes file
Route::get('my-page', 'MyController')->middleware('throttle');
```All the options available for the stock Laravel throttle are also applicable with this package.
### Security
If you discover any security related issues, please email soy@miguelpiedrafita.com instead of using the issue tracker.
## Credits
- [Miguel Piedrafita](https://github.com/m1guelpf)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.