From 602a151104092803245e42359ffb77d488c9ed2e Mon Sep 17 00:00:00 2001 From: lukinovec Date: Tue, 9 Jun 2026 14:18:30 +0200 Subject: [PATCH] Expand CacheTenancyBootstrapper docblock Mention that it's not intended to be used with database cache stores (it *can* be used with db cache stores, there's just a little unexpected behavior). --- src/Bootstrappers/CacheTenancyBootstrapper.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Bootstrappers/CacheTenancyBootstrapper.php b/src/Bootstrappers/CacheTenancyBootstrapper.php index 97bd7d24..d13ab9b5 100644 --- a/src/Bootstrappers/CacheTenancyBootstrapper.php +++ b/src/Bootstrappers/CacheTenancyBootstrapper.php @@ -16,6 +16,15 @@ use Stancl\Tenancy\Contracts\Tenant; /** * Makes cache tenant-aware by applying a prefix. + * + * Using this bootstrapper together with DatabaseTenancyBootstrapper + * with a database cache store results in double scoping. The store is scoped by + * DB connection (entries go into the tenant's database) *and* by the prefix. This is + * harmless for most use cases, but can produce unexpected behavior. + * + * If you're using a database cache store, use DatabaseCacheBootstrapper instead of this one. + * + * @see Stancl\Tenancy\Bootstrappers\DatabaseCacheBootstrapper */ class CacheTenancyBootstrapper implements TenancyBootstrapper {