Rate limiting and throttle

From jpcaparas/superpowers-laravel · View interactive version

Rate limiting and throttle is an AI agent skill from the GitHub repository jpcaparas/superpowers-laravel. Apply per-user and per-route limits with RateLimiter and throttle middleware; use backoffs and headers for clients

How to use this skill

Skill file

Rate Limiting and Throttle

Protect endpoints from abuse while keeping UX predictable.

Commands

// App\Providers\RouteServiceProvider
RateLimiter::for('api', function (Request $request) {
    return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
});

// routes/api.php
Route::middleware(['throttle:api'])->group(function () {
    // ...
});

Patterns

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.