From a07467dcbd015977de9b765ab799c59bb4c90952 Mon Sep 17 00:00:00 2001 From: Chris Brown Date: Wed, 5 Feb 2025 17:02:05 -0500 Subject: [PATCH] Mention custom cache bootstrapper --- docs/advanced-usage/cache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced-usage/cache.md b/docs/advanced-usage/cache.md index 374410af..5e76828e 100644 --- a/docs/advanced-usage/cache.md +++ b/docs/advanced-usage/cache.md @@ -68,7 +68,7 @@ Laravel Tip: If you are leveraging a caching service such as `redis` or `memcach To prevent other applications from accidentally using/changing your cached data, it is prudent to set your own cache `prefix` in Laravel's `/config/cache.php` to something unique for each application which shares the same caching service. -Most multi-tenant "packages" take care of this for you when switching tenants. +Most multi-tenant "packages" take care of this for you when switching tenants. Optionally you might need to change cache boot order by writing a custom [cache boostrapper](https://github.com/spatie/laravel-permission/discussions/2310#discussioncomment-10855389). Tip: Most parts of your multitenancy app will relate to a single tenant during a given request lifecycle, so the following step will not be needed: However, in the less-common situation where your app might be switching between multiple tenants during a single request lifecycle (specifically: where changing the cache key/prefix (such as when switching between tenants) or switching the cache store), then after switching tenants or changing the cache configuration you will need to reinitialize the cache of the `PermissionRegistrar` so that the updated `CacheStore` and cache configuration are used.