PHPackages                             muhamed-didovic/throttle - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. muhamed-didovic/throttle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

muhamed-didovic/throttle
========================

PHP throttle package

1.2.7(7y ago)457[1 issues](https://github.com/muhamed-didovic/php-throttle/issues)MITPHP

Since Feb 22Pushed 7y ago3 watchersCompare

[ Source](https://github.com/muhamed-didovic/php-throttle)[ Packagist](https://packagist.org/packages/muhamed-didovic/throttle)[ RSS](/packages/muhamed-didovic-throttle/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (10)Versions (14)Used By (0)

PHP Throttle
============

[](#php-throttle)

PHP Throttle is a rate limiter for Zend / Laravel or PHP and was made and maintained by [Muhamed Didovic](https://github.com/muhamed-didovic) and [Goran Radosevic](https://github.com/gradosevic).

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

[](#installation)

PHP Throttle requires [PHP](https://php.net) 5.5 and up

To get the latest version, simply require the project using [Composer](https://getcomposer.org):

```
$ composer require muhamed-didovic/throttle
```

Usage
-----

[](#usage)

```
$config = [
    'cache.path' => '/tmp',
    'cache.driver' => 'file',
    'limit' => 10,
    'time' => 1,
    'routes' => [
        [
            'url' => '/signup',
            'limit' => 10
        ],
        [
            'url' => '/signin',
            'limit' => 3,
        ],
        [
            'url' => '/signin',
            'limit' => 2,
            'method' => 'POST'
        ]
    ]
];

$throttle = (new ThrottleApp($config))->getThrottle();

if (!$throttle->attempt($request)) {
    echo "Rate limit exceeded. Please wait " . 60 . " sec."; die;
}

```

Please note that $request can be different for different systems

### ZEND

[](#zend)

- $request is an instance of Zend\_Controller\_Request\_Http

### LARAVEL

[](#laravel)

- $request is na instance of Illuminate\\Http\\Request

### Array

[](#array)

- $request is an array

```
$request = [
   'ip' => '127.0.0.1',
   'method' => 'POST',
   'route' => '/example-page'
];

```

### Object

[](#object)

- $request is an object

```
$request = (object)[
   'ip' => '127.0.0.1',
   'method' => 'POST',
   'route' => '/example-page'
];

```

Configuration Parameters
------------------------

[](#configuration-parameters)

All configuration parameters are optional. Add your own to override the defaults.

### cache.path

[](#cachepath)

Path to the cache folder. "/tmp" by default

### cache.driver

[](#cachedriver)

Currently we support only "file" driver type

### limit

[](#limit)

The number of allowed hits in a period of time. Default: 100

### time

[](#time)

A period of time, in minutes where we check for attempts. Default 1, minute.

### routes

[](#routes)

Add here specific routes to check. All other routes will not be used against throttle. If you don't provide this parameter, all routes will be checked against throttle

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 82.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

13

Last Release

2584d ago

Major Versions

v0.0.1 → v1.0.12019-02-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/d87e17a6168f5ae69bddb8d0983cd73b4a176816e33309a9e6bb5d97813a7ece?d=identicon)[muhamed-didovic](/maintainers/muhamed-didovic)

---

Top Contributors

[![muhamed-didovic](https://avatars.githubusercontent.com/u/3872717?v=4)](https://github.com/muhamed-didovic "muhamed-didovic (33 commits)")[![gradosevic](https://avatars.githubusercontent.com/u/10562516?v=4)](https://github.com/gradosevic "gradosevic (7 commits)")

---

Tags

phpthrottlethrottlingzendzend-framework

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/muhamed-didovic-throttle/health.svg)

```
[![Health](https://phpackages.com/badges/muhamed-didovic-throttle/health.svg)](https://phpackages.com/packages/muhamed-didovic-throttle)
```

###  Alternatives

[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[genealabs/laravel-model-caching

Automatic caching for Eloquent models.

2.4k4.8M26](/packages/genealabs-laravel-model-caching)[mikebronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k127.1k1](/packages/mikebronner-laravel-model-caching)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
