mcpField
L
laravel:rate-limiting

laravel:rate-limiting

github.com/jpcaparasDevelopment157135 installsUpdated 17w ago
Repository

About laravel:rate-limiting

A Laravel development skill for protecting endpoints with rate limits while keeping client behavior predictable. It describes user- or IP-based limits, standard response headers, retry guidance for 429 responses, and separate limiters for bursty endpoints.

Key features

  1. 01Limit requests by user or IP
  2. 02Communicate limits with standard headers
  3. 03Include retry hints in 429 responses
  4. 04Use separate limiters for bursty endpoints

Use cases

  1. 01Applying per-user limits to authenticated API requests
  2. 02Applying IP-based limits when a user is unauthenticated
  3. 03Configuring separate limits for bursty routes

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/jpcaparas/superpowers-laravel --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