Skip to content

Commit

Permalink
Mention custom cache bootstrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
drbyte authored Feb 5, 2025
1 parent 0356f8d commit a07467d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/advanced-usage/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit a07467d

Please sign in to comment.