semitexa / tenancy
Semitexa Tenancy - tenant resolution, scoped context, and multi-tenant application support
Package info
github.com/semitexa/semitexa-tenancy
Type:semitexa-module
pkg:composer/semitexa/tenancy
Requires
- php: ^8.4
- semitexa/core: *
This package is auto-updated.
Last update: 2026-04-05 09:00:35 UTC
README
Tenant resolution, scoped context, and multi-tenant application support.
Purpose
Resolves the current tenant per request through a configurable chain of strategies (path, subdomain, header, query param). Stores the resolved tenant in coroutine-safe context for downstream use by ORM, Cache, Storage, and other tenant-aware packages.
Role in Semitexa
Depends on Core. Depended on by ORM, Cache, Search, Media, Scheduler, Workflow, and optionally Locale. Tenancy is foundational to the multi-tenant architecture — when active, ORM scopes queries, Cache namespaces keys, and Storage isolates paths, all transparently based on the resolved tenant.
Key Features
TenancyBootstrapperbuilds resolver chain from env config- Resolution strategies: path, subdomain, header, query param
TenantContextwith coroutine-safeCoroutineContextStoreTenantResolverChaincomposable resolver ordering- Multi-layer tenancy via
LayerDefinition #[AsTenantLayerStrategy]attribute for custom layersTenantRepositoryInterfacefor tenant lookup (config or database-backed)