spatie/laravel-rate-limited-job-middleware
Laravel job middleware to rate limit queued jobs. Allow a configurable number of jobs per second and automatically release throttled jobs for a delay. Easy to attach per job via middleware, with support for time-based attempts when rate limiting.
For Executives: "This package lets us control how often background jobs run—like a traffic cop for our app’s workload. For example, if we’re sending 10,000 emails via SendGrid, we can cap them at 500/hour to avoid costs or bans. It’s a 10-minute setup that prevents technical debt and saves money on cloud resources. Used by [X] companies, it’s battle-tested and open-source, so no vendor lock-in."
For Engineering: *"Spatie’s rate-limiting middleware for Laravel jobs solves a common pain point: uncontrolled job execution. Key benefits:
RateLimitJobMiddleware::limit(50)->perMinute()).RateLimitJobMiddleware::limit(10)->perSecond()).For Developers: *"Need to throttle jobs? This middleware lets you define limits like:
public function handle()
{
// Runs at most 10 times per minute
RateLimitJobMiddleware::limit(10)->perMinute();
// ... rest of job logic
}
How can I help you explore Laravel packages today?