Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.