mirror of
https://github.com/archtechx/tenancy.git
synced 2026-06-21 14:24:04 +00:00
1.6 KiB
1.6 KiB
Filesystem Cache Queue Reference
Use this when tenant context affects storage, cache, sessions, Redis, or queues.
Source Files
src/Bootstrappers/FilesystemTenancyBootstrapper.phpsrc/Bootstrappers/CacheTenancyBootstrapper.phpsrc/Bootstrappers/CacheTagsBootstrapper.phpsrc/Bootstrappers/DatabaseCacheBootstrapper.phpsrc/Bootstrappers/RedisTenancyBootstrapper.phpsrc/Bootstrappers/QueueTenancyBootstrapper.phpsrc/Bootstrappers/PersistentQueueTenancyBootstrapper.phpsrc/Bootstrappers/DatabaseSessionBootstrapper.phpsrc/Middleware/ScopeSessions.php
Filesystem
filesystem.diskscontrols scoped disks.filesystem.root_overriderewrites local disk roots.filesystem.url_overrideenables tenant-aware local public URLs.filesystem.suffix_storage_pathcontrolsstorage_path()suffixing.filesystem.asset_helper_overridemakesasset()tenant-aware.
Cache And Redis
- Cache tenancy prefixes configured stores through
cache.prefix. - Global central cache is available through
GlobalCache/globalCache(). - Redis tenancy is for direct Redis usage and requires phpredis.
Queue
- Queue bootstrapper carries tenant context into queued jobs.
- Persistent queue bootstrapper is for workers intentionally staying tenant-aware.
Rules
- Run
php artisan tenants:linkwhen tenant public local storage URLs are enabled. - Be careful with
asset_helper_override; third-party package assets may become tenant-aware. - Scope sessions through config and
ScopeSessionsmiddleware where required. - Test queued jobs in central and tenant contexts.