Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/f1uder/livewire-throttling
Livewire trait (throttling). Limiting request processing speed
https://github.com/f1uder/livewire-throttling
laravel livewire livewire-components livewire-packages
Last synced: about 1 month ago
JSON representation
Livewire trait (throttling). Limiting request processing speed
- Host: GitHub
- URL: https://github.com/f1uder/livewire-throttling
- Owner: f1uder
- License: mit
- Created: 2022-08-19T11:11:47.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-13T17:50:39.000Z (7 months ago)
- Last Synced: 2024-04-14T07:12:23.108Z (7 months ago)
- Topics: laravel, livewire, livewire-components, livewire-packages
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Livewire Throttling
[![Latest Version on Packagist](https://img.shields.io/packagist/v/f1uder/livewire-throttling.svg?style=flat-square)](https://packagist.org/packages/f1uder/livewire-throttling)
[![Total Downloads](https://img.shields.io/packagist/dt/f1uder/livewire-throttling.svg?style=flat-square)](https://packagist.org/packages/f1uder/livewire-throttling)## Installation
You can install the package via composer:
```bash
composer require f1uder/livewire-throttling
```## Usage Livewire component
```php
rateLimit('10'); // Limit 10 requests per minute
}
public function testCallback()
{
$this->rateLimit('10', function ($sec) {
abort(429);
});
}
}
```### Clear Rate Limit
```php
$this->clearRateLimit();
```### Lang message error (support: en)
Add Russian lang`lang/ru.json`
```php
"Too many requests, try again in :sec seconds.": "Слишком много запросов, повторите попытку через :sec сек."
```## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.