# Laravel Rate Limiting

> Apply per-user and per-route limits with RateLimiter and throttle middleware; use backoffs and headers for clients

- Skill: `noartem/laravel-rate-limiting` (Agent Skill)
- Install (CLI): `npx skillmds@latest add noartem/laravel-rate-limiting`
- Raw SKILL.md: https://api.skillmd.com/api/skills/noartem/laravel-rate-limiting/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: noartem (https://skillmd.com/u/noartem)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/noartem/laravel-rate-limiting

---


# 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

