PHPackages                             madmikeyb/throttleable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. madmikeyb/throttleable

ActiveLibrary[Security](/categories/security)

madmikeyb/throttleable
======================

Temporarily disallow IP addresses from taking certain actions within your Laravel Application

0.5(6y ago)513MITPHPPHP &gt;=7.0

Since Oct 25Pushed 6y ago2 watchersCompare

[ Source](https://github.com/MadMikeyB/throttleable)[ Packagist](https://packagist.org/packages/madmikeyb/throttleable)[ Docs](https://github.com/madmikeyb/throttleable)[ RSS](/packages/madmikeyb-throttleable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (6)Used By (0)

Laravel Throttleable
====================

[](#laravel-throttleable)

[![Packagist](https://camo.githubusercontent.com/17fd521cbc8b8f9680fc2c357d4b081b732a6525baa93f06a360b94127799f0e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61646d696b6579622f7468726f74746c6561626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/madmikeyb/throttleable)![Packagist](https://camo.githubusercontent.com/6f1b665bc3b379d69c7d37691953e73f4910397f3745d2d7e76d44eaf012e392/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d61646d696b6579622f7468726f74746c6561626c652e7376673f7374796c653d666c61742d737175617265)

Throttle requests to your application based on users IP address.

- Set a threshold on how many requests an IP address can make.
- Throttles expire after a configurable period of time.
- Throttles are unique per IP address.
- Configurable through `config/throttleable.php`

Installation
------------

[](#installation)

Pull in the package using Composer

```
composer require madmikeyb/throttleable

```

> **Note**: If you are using Laravel 5.5, the next steps are unnecessary. Laravel Throttleable supports Laravel [Package Discovery](https://laravel.com/docs/5.5/packages#package-discovery).

Include the service provider within `app/config/app.php`.

```
'providers' => [
    ...
    MadMikeyB\Throttleable\Providers\ThrottleableServiceProvider::class,
],
```

Migrations
----------

[](#migrations)

You must publish [the migration](https://github.com/madmikeyb/throttleable/blob/master/database/migrations/create_throttles_table.php.stub) by running the following command:

```
php artisan vendor:publish --provider="MadMikeyB\Throttleable\Providers\ThrottleableServiceProvider" --tag="migrations" && php artisan migrate
```

Configuration
-------------

[](#configuration)

Throttleable supports optional configuration.

You can publish the config file with:

```
php artisan vendor:publish --provider="MadMikeyB\Throttleable\Providers\ThrottleableServiceProvider" --tag="config"
```

When published, [the `config/throttleable.php` config file](https://github.com/madmikeyb/throttleable/blob/master/config/throttleable.php) contains:

```
