---
title: "Defaults & overrides — HTTP Client Rate Limits for Laravel | Roundly"
description: "Set the default store and deferrer in config, override them per call site with RateLimits::usingStore() / usingDeferrer(), or per instance."
url: https://roundly-consulting.com/open-source/docs/http-client-rate-limits-for-laravel/defaults
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[HTTP Client Rate Limits for Laravel](https://roundly-consulting.com/open-source/docs/http-client-rate-limits-for-laravel.md)

# Defaults & overrides

## Globally, in config

Set store / deferrer in config/http-client-rate-limits.php: every limit the manager builds uses them — the RateLimits facade, an injected manager, named profiles, compound arrays and every form of Http::rateLimit():

```php
use RoundlyConsulting\HttpClientRateLimits\Store\CacheStore;

// config/http-client-rate-limits.php
'store' => CacheStore::class,
'cache_store' => 'redis',                   // any store from config/cache.php (null = default)
'cache_prefix' => 'http-client-rate-limits',
```

## Per call site

RateLimits::usingStore() / usingDeferrer() return a configured copy of the manager, so the shared singleton is never mutated:

```php
use RoundlyConsulting\HttpClientRateLimits\Facades\RateLimits;
use RoundlyConsulting\HttpClientRateLimits\Store\RedisStore;

$limits = RateLimits::usingStore(new RedisStore('cache'))->usingDeferrer(new MyDeferrer);

$limits->perMinute(30);
```

A copy that doesn’t override the store keeps sharing the manager’s config-resolved one, so hits still accumulate in one budget per process. RateLimits::releasingJob() is the same kind of copy, with the ReleaseDeferrer.

## Per instance

```php
use RoundlyConsulting\HttpClientRateLimits\Facades\RateLimits;
use RoundlyConsulting\HttpClientRateLimits\Store\RedisStore;

$middleware = RateLimits::perMinute(30);

$middleware->setStore(new RedisStore('cache')); // share limits across processes via Redis
$middleware->setDeferrer($myDeferrer);
```

## Resolution order

- setStore() / setDeferrer() on an instance — always wins for that instance.
- RateLimits::usingStore() / usingDeferrer() / releasingJob() — for limits built from that manager copy.
- The store and deferrer config keys — everything else.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/http-client-rate-limits-for-laravel.md)
