Search by

marko / ratelimiter

markshust

Rate limiting for Marko Framework

Package info

github.com/marko-php/marko-ratelimiter

Type:marko-module

pkg:composer/marko/ratelimiter

Statistics

Installs: 100

Dependents: 2

Suggesters: 1

Stars: 0

0.11.0 2026-10-06 14:04 UTC

This package is auto-updated.

Last update: 2026-10-09 21:31:35 UTC


README

Cache-backed rate limiter with route middleware --- per-route limits via #[RateLimit], IPv6-safe keys and automatic Retry-After headers.

Installation

composer require marko/ratelimiter

Quick Example

use Marko\RateLimiter\Attributes\RateLimit;
use Marko\RateLimiter\Middleware\RateLimitMiddleware;
use Marko\Routing\Attributes\Middleware;
use Marko\Routing\Attributes\Post;
use Marko\Routing\Http\Response;

class LoginController
{
    #[Post('/login')]
    #[Middleware(RateLimitMiddleware::class)]
    #[RateLimit(maxAttempts: 5, decaySeconds: 60, name: 'login')]
    public function login(): Response
    {
        return new Response('OK');
    }
}

Documentation

Full configuration, middleware usage and API reference: marko/ratelimiter