PHPackages                             lajouizakariae/rate-limiter - 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. lajouizakariae/rate-limiter

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

lajouizakariae/rate-limiter
===========================

Rate limiter built with Php

0.0.2(2y ago)16PHPPHP &gt;=8.1

Since Mar 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/lajouiZakariae/rate-limiter)[ Packagist](https://packagist.org/packages/lajouizakariae/rate-limiter)[ RSS](/packages/lajouizakariae-rate-limiter/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Rate Limiter Built With Php
===========================

[](#rate-limiter-built-with-php)

Introduction
------------

[](#introduction)

This package is a rate limiter that allows you to define a limit per (minute,hour, or any number of seconds) It Provides different methods that allow you to define, delete, increment the rate.

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

[](#installation)

```
composer require lajouizakariae/rate-limiter

```

Basic Usage
-----------

[](#basic-usage)

```
use RateLimiter\RateLimiter;

$rateLimiter = new RateLimiter([
    'storage' => "file",
    'path' => "storage/cache",
]);

$rateLimiter->limitHourly('user:one', 3);

if ($rateLimiter->tooManyAttempts('user:one')) {
    # Do Something
}

$rateLimiter->hit('user:one');
```

Create a Rate Limiter
---------------------

[](#create-a-rate-limiter)

You can create a rate limiter by instanciating the RateLimiter class, the only required parameter is an associative array.

You need to define wich type of storage you will be using, currently this package only supports the file system storage.

If you choose to save the rate limiter's data in the file system you need to provide a path key that shows the rate limiter where to store the data.

If the directory does not exist it will create it for you.

Note: The path should be an absolute path to the directory where you want the data to be saved.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

838d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/80148036?v=4)[Zakariae Lajoui](/maintainers/lajouiZakariae)[@lajouiZakariae](https://github.com/lajouiZakariae)

---

Top Contributors

[![lajouiZakariae](https://avatars.githubusercontent.com/u/80148036?v=4)](https://github.com/lajouiZakariae "lajouiZakariae (30 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lajouizakariae-rate-limiter/health.svg)

```
[![Health](https://phpackages.com/badges/lajouizakariae-rate-limiter/health.svg)](https://phpackages.com/packages/lajouizakariae-rate-limiter)
```

###  Alternatives

[fbf/laravel-comments

A Laravel 4 package for adding commenting to a website that has user accounts

214.6k](/packages/fbf-laravel-comments)

PHPackages © 2026

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