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
- 01Configure Laravel rate limiters
- 02Scope limits by user or IP
- 03Send standard limit headers
- 04Return 429 responses with retry hints
- 05Separate limits for bursty endpoints
Use cases
- 01Throttle API routes
- 02Limit unauthenticated traffic by IP
- 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-limitingAfter installing, type/laravel-rate-limitingin Claude Code to confirm it loaded.
Details
From the project READMERate 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