mcpField
L
laravel-rate-limiting

laravel-rate-limiting

github.com/noartemDevelopment1369 installsUpdated 2w ago
Repository

About laravel-rate-limiting

A Laravel rate-limiting reference for protecting endpoints while keeping client behavior predictable. It outlines user-or-IP scoping, standard limit headers, retry hints for 429 responses, and separate limits for bursty endpoints.

Key features

  1. 01Configure Laravel rate limiters
  2. 02Scope limits by user or IP
  3. 03Send standard limit headers
  4. 04Return 429 responses with retry hints
  5. 05Separate limits for bursty endpoints

Use cases

  1. 01Throttle API routes
  2. 02Limit unauthenticated traffic by IP
  3. 03Give clients retry guidance after rate limits

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/noartem/skills --skill laravel-rate-limiting

After installing, type/laravel-rate-limitingin Claude Code to confirm it loaded.

Details

From the project README

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

  • Scope limits by user when authenticated; fall back to IP
  • Communicate limits to clients via standard headers
  • Provide sensible 429 responses with retry hints
  • Separate bursty endpoints into specialized limiters

Comments

Markdown supported