Tenancy is a PHP package that provides multi-tenant architecture for Laravel applications, automatically isolating data and operations per tenant. It identifies the active tenant from the incoming request's hostname, including support for second-level domains, and scopes all database queries, cache, and storage to that tenant without requiring manual filtering or model trait modifications.
The package automatically detects the current tenant from the request context and sets it for the session, ensuring each tenant sees only its own data. It also supports running background jobs that are scoped to a single tenant, keeping job data and side effects isolated from other tenants.