agentsclimarketplace

Laravel rate limiting and throttle

Skill ComeOnOliver/skillshub/skills/noartem/skills/laravel-rate-limiting-and-throttle

🧠 The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.

Install
npx -y skills add ComeOnOliver/skillshub --skill laravel-rate-limiting-and-throttle

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

0.6 KB, as published. Nobody here has run it

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

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.