Skip to content
CAI
Software that uses CAICheck a score

archtechx/tenancy

52.4

Adequate · 17 November 2026

12.1k

lines of production code

PHP

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add GlobalCache and Tenancy facades

New facades have been introduced to provide static access to specific services. The GlobalCache facade extends the standard Laravel Cache facade to allow access to the global cache store, ensuring compatibility with the global\_cache() helper. The Tenancy facade provides static access to the main Tenancy service class, enabling easier interaction with tenancy features throughout the application.

src/Facades · high confidence

Add tenant and domain database migrations

The system now includes database migration files to create the core \tenants\ and \domains\ tables. The \tenants\ table stores tenant identifiers and includes a nullable JSON \data\ column for custom attributes, along with standard timestamps. The \domains\ table maps domain names to tenants using a foreign key relationship that cascades updates, ensuring domain records remain linked to their parent tenant.

assets/migrations · high confidence

Added Doctum configuration for API documentation generation

The doctum directory now includes a configuration file (doctum.php) and a .gitignore to support generating API documentation for the Tenancy for Laravel project. The configuration sets up Doctum to scan PHP files in the src directory, defines version support for 1.x, 2.x, 3.x, and master branches, and configures build/cache directories and remote repository integration with GitHub.

doctum · high confidence

Introduce base event contracts for domain, tenancy, and tenant events

Added three new abstract base classes—DomainEvent, TenancyEvent, and TenantEvent—in the src/Events/Contracts directory to standardize event structures. DomainEvent includes a domain property and model serialization, TenancyEvent accepts a Tenancy instance, and TenantEvent accepts a Tenant instance with model serialization, providing a consistent foundation for future event implementations.

src/Events/Contracts · high confidence

Introduces abstract CachedTenantResolver with cache invalidation support

Adds a new abstract base class, CachedTenantResolver, to the contracts layer that implements the TenantResolver interface. This class provides a standardized mechanism for caching tenant resolution results using a global cache repository, configurable via tenancy identification settings (cache enablement, TTL, and store). It includes logic to check the cache before resolving, store results with a specified TTL, and a new invalidateCache method that allows subclasses to clear specific cache keys associated with a tenant, addressing previous issues where cached lookups could not be properly invalidated.

src/Resolvers/Contracts · high confidence

New TenantAssetController for serving tenant-specific files

A new TenantAssetController has been introduced to serve static assets from the tenant's storage directory (app/public) or a configured public disk. This controller allows users to serve tenant-scoped files via a single route, supporting custom headers and middleware configuration through static properties. It includes built-in protection against path traversal attacks and ensures that assets are only served within the tenant's context, requiring the FilesystemTenancyBootstrapper to be enabled.

src/Controllers · high confidence

New bootstrappers for Fortify tenant redirects and Scout tenant prefixing

Added FortifyRouteBootstrapper to customize Laravel Fortify action redirects so they point to tenant routes instead of central ones, with configurable options for passing tenant parameters via path or query string. Added ScoutPrefixBootstrapper to automatically set the Scout search prefix to the tenant key, ensuring search results are scoped to the current tenant context.

src/Bootstrappers/Integrations · high confidence

New developer tooling and configuration scaffolding

The repository now includes a comprehensive set of development aids: a Docker-based test environment (Dockerfile, docker-compose.yml) supporting MySQL, PostgreSQL, SQL Server, Redis, Memcached, and DynamoDB; shell scripts (\test\, \t\) for running Pest tests; a PHP CS Fixer configuration for code style enforcement; a PHPStan configuration (level 8) for static analysis; and documentation files (CLAUDE.md, CONTRIBUTING.md, SUPPORT.md) to guide contributors and AI assistants. These changes standardize the local development and CI experience but do not alter the package's runtime behavior.

(repo-wide) · high confidence

New domain, tenant, and impersonation token models with event-driven persistence

The package now provides explicit Eloquent models for core tenancy entities: Domain, Tenant, and ImpersonationToken. The Domain model manages domain-to-tenant mapping, automatically converts domains to lowercase, and ensures domains are not occupied by other tenants. The Tenant model serves as the central tenant entity, supporting custom tenant key names, current tenant resolution via current() and currentOrFail(), and integration with virtual columns for dynamic attributes. The ImpersonationToken model enables secure user impersonation across tenants, requiring stateful guards and storing token metadata including authentication guard and redirect URLs. All models dispatch comprehensive lifecycle events (creating, created, saving, saved, updating, updated, deleting, deleted) allowing applications to hook into tenant, domain, and impersonation token operations.

src/Database/Models · high confidence

New event classes for resource syncing lifecycle

The ResourceSyncing module now exposes a set of domain events to track the state of synced resources. These include CentralResourceAttachedToTenant and CentralResourceDetachedFromTenant for tenant attachment changes, SyncMasterDeleted and SyncMasterRestored for central resource lifecycle, and SyncedResourceSaved, SyncedResourceDeleted, and SyncedResourceSavedInForeignDatabase for individual resource updates. These events allow listeners to react to specific synchronization states, with SyncedResourceSavedInForeignDatabase explicitly marked as internal for test assertions only.

src/ResourceSyncing/Events · high confidence

This change introduces three new action classes in the src/Actions directory to handle specific tenancy tasks. CloneRoutesAsTenant provides a fluent API to clone existing routes for tenant usage, allowing configuration of tenant parameters, middleware, domains, and custom cloning logic to support path-based identification. CreateStorageSymlinksAction and RemoveStorageSymlinksAction manage the creation and removal of symlinks between tenant storage directories and public paths, with support for relative links, force overwrites, and optional cleanup of nested empty directories.

src/Actions · high confidence

New tenancy command and routing traits for parallel migrations and route context management

The \src/Concerns\ directory now includes several new traits that enhance command execution and route handling. \ParallelCommand\ introduces support for parallelizing tenant operations (such as migrations) by forking child processes, automatically detecting logical CPU cores, and allowing users to override the process count via the \-p\ flag or bypass the maximum limit with \-P\. \TenantAwareCommand\ and \HasTenantOptions\ provide a standardized way to run commands across specific tenants, supporting options to skip tenants and include pending tenants in queries. \DealsWithRouteContexts\ refactors how routes are classified (tenant, central, or universal), prioritizing universal flags and supporting deep middleware group unpacking to determine the correct context. \UsableWithEarlyIdentification\ ensures that kernel-level identification is correctly skipped when route-level identification is used, preventing redundant middleware execution. \DealsWithTenantSymlinks\ and \ManagesRLSPolicies\ add specific utilities for managing tenant file symlinks and PostgreSQL Row Level Security policies respectively.

src/Concerns · high confidence

New tenancy features: cross-domain redirects, SQLite security, Vite bundling, and user impersonation

This release introduces several new feature classes in the src/Features directory. CrossDomainRedirect adds a macro to RedirectResponse to easily switch the hostname in redirect URLs to a specified domain. DisallowSqliteAttach prevents SQLite ATTACH commands for security, using native PHP 8.5 authorizers or a custom extension on older versions. TelescopeTags automatically tags Laravel Telescope entries with the current tenant ID. TenantConfig (now deprecated in favor of TenantConfigBootstrapper) allows mapping tenant storage keys to application config values. UserImpersonation provides a secure, token-based system for impersonating users across tenants, including session management and configurable TTL. ViteBundler ensures that Vite asset paths are correctly resolved to global assets during tenancy.

src/Features · high confidence

New tenancy lifecycle and maintenance mode events

The \src/Events\ directory now exposes a comprehensive set of new event classes to allow listeners to hook into specific stages of the tenancy lifecycle. These include events for bootstrapping and ending tenancy, creating, saving, updating, and deleting tenants, domains, and their associated databases and storage symlinks. Additionally, new \TenantMaintenanceModeEnabled\ and \TenantMaintenanceModeDisabled\ events have been added to track maintenance state changes, and \PullingPendingTenant\ is introduced to handle pending tenant operations within a database transaction.

src/Events · high confidence

New tenant database managers for SQL Server, MySQL, PostgreSQL, and SQLite

The package now includes dedicated database manager classes for Microsoft SQL Server, MySQL, PostgreSQL, and SQLite, replacing the previous generic implementation. These managers handle tenant database creation, deletion, and existence checks using database-specific SQL syntax. Additionally, permission-controlled variants are provided for SQL Server, MySQL, and PostgreSQL, which automatically create database users and grant specific permissions (such as SELECT, INSERT, UPDATE, DELETE, and EXECUTE for SQL Server, or a broader set for MySQL) to isolate tenant data access. The SQLite manager supports both file-based and named in-memory databases, with configurable persistence logic for in-memory connections.

src/Database/TenantDatabaseManagers · high confidence

New tenant identification resolvers for domains, paths, and request data

The \src/Resolvers\ directory now includes three new tenant identification strategies: \DomainTenantResolver\ identifies tenants by matching the request's domain against stored domain records (supporting both single-domain and multi-domain tenants); \PathTenantResolver\ identifies tenants via a configurable route parameter (defaulting to 'tenant') and allows whitelisting extra model columns for lookup; and \RequestDataTenantResolver\ identifies tenants using configurable headers, query parameters, or cookies. All three extend \CachedTenantResolver\ to support caching with configurable TTL and store settings, and they provide methods to generate cache keys based on the resolved tenant's attributes.

src/Resolvers · high confidence

New tenant key identifier generators added

Added new unique identifier generators for tenant keys, including RandomHexGenerator, RandomIntGenerator, RandomStringGenerator, ULIDGenerator, UUIDGenerator, and UUIDv7Generator, providing users with additional options for generating tenant identifiers.

src/UniqueIdentifierGenerators · high confidence

New tenant-aware bootstrappers for broadcasting, caching, logging, and sessions

This change introduces a suite of new bootstrappers in the src/Bootstrappers directory to handle tenancy for various Laravel subsystems. BroadcastChannelPrefixBootstrapper and BroadcastingConfigBootstrapper now prefix broadcast channel names with tenant keys and map tenant credentials to broadcasting config for Pusher, Reverb, and Ably. Cache handling is split into CacheTagsBootstrapper (legacy tagging), CacheTenancyBootstrapper (prefix-based), and DatabaseCacheBootstrapper (switching database connections for cache stores). DatabaseSessionBootstrapper ensures the database session driver uses the correct tenant connection. LogChannelBootstrapper configures logging channels to write to tenant-specific storage paths or apply custom overrides. FilesystemTenancyBootstrapper has been updated to support scoped disk configuration and improved asset URL handling. DatabaseTenancyBootstrapper now includes a hardening mode to prevent cross-tenant database access.

src/Bootstrappers · high confidence

Queueable jobs for tenant lifecycle operations

New queueable jobs have been added to the \src/Jobs\ directory to handle tenant database and storage operations asynchronously. These include \CreateDatabase\, \DeleteDatabase\, \MigrateDatabase\, \SeedDatabase\, \CreatePendingTenants\, \ClearPendingTenants\, \CreateStorageSymlinks\, \RemoveStorageSymlinks\, \DeleteDomains\, and \DeleteTenantStorage\. This allows users to offload resource-intensive tasks like database creation, migration, seeding, and storage cleanup to the queue, improving application responsiveness during tenant provisioning and decommissioning.

src/Jobs · high confidence

Removals

Removal of BootstrapsTenancy trait

The \BootstrapsTenancy\ trait has been removed from the codebase. This trait previously handled the initialization of tenancy by switching database connections, configuring Redis prefixes, tagging the cache, and suffixing filesystem root paths. Its removal indicates that these bootstrapping responsibilities have been moved to a different location or handled via a different mechanism.

src/Traits · high confidence

Removal of Redis storage driver

The Redis storage driver implementation has been removed from the codebase. This eliminates the ability to use Redis as a backend for storing tenant data and configuration, requiring users to migrate to alternative storage drivers supported by the system.

src/StorageDrivers · high confidence

Removal of StorageDriver interface

The StorageDriver interface has been removed from the codebase. This eliminates the contract previously defining methods for tenant identification, retrieval, creation, deletion, and generic key-value storage operations.

src/Interfaces · high confidence

Behavioural changes

2 commits (0 fixes) modifying src/RLS/Exceptions

A change to existing behaviour in src/RLS/Exceptions — 2 commits, 2 files: “\[4.x\] TableRLSManager refactor, comment constraints (\#1354)”; “Throw an exception when an RLS policy name would be too long (\#1515)” (refs \#1354, \#1515).

src/RLS/Exceptions · medium confidence · unverified

Add DisallowSqliteAttach feature

A new SQLite extension has been added to the extensions directory that disables the SQLite ATTACH command. The C source code implements an authorizer that explicitly denies the SQLITE\_ATTACH action, and the accompanying Makefile provides build instructions for generating the shared library (DLL, dylib, or SO) across Windows, macOS, and Linux platforms.

extensions · high confidence

Add remember column to impersonation token table

The migration for the \tenant\_user\_impersonation\_tokens\ table now includes a \remember\ boolean column, allowing impersonation sessions to persist across browser restarts when the user opts to be remembered.

assets/impersonation-migrations · high confidence

Introduction of Context and RouteMode enums

The library now provides native PHP enums to represent tenancy context and routing modes. A new \Context\ enum defines the \TENANT\ and \CENTRAL\ states, while a backed integer \RouteMode\ enum introduces \CENTRAL\, \TENANT\, and \UNIVERSAL\ modes to control how routes are resolved. These enums replace or supplement previous configuration approaches with a type-safe structure.

src/Enums · high confidence

Introduction of tenant resource mapping table

A new database migration has been added to create the \tenant\_resources\ table, which stores mappings between tenants and their associated resources. This table includes columns for the tenant ID, the resource's global ID, and a type field intended to support polymorphic relationships, enabling the system to link specific resource types to individual tenants.

assets/resource-syncing-migrations · high confidence

Major overhaul of tenant management commands with parallel execution and new capabilities

The \src/Commands\ directory has been significantly refactored and expanded. Migration commands (\tenants:migrate\, \tenants:rollback\, \tenants:migrate-fresh\) now support parallel execution via a \--processes\ option and include a \--skip-failing\ flag to continue on errors. New commands have been added: \tenants:pending-create\ and \tenants:pending-clear\ for managing pending tenants, \tenants:down\ and \tenants:up\ for putting tenants into and out of maintenance mode, \tenants:purge-impersonation-tokens\ to clear expired tokens, \tenants:rls\ to create Row Level Security policies for PostgreSQL, and \tenant:tinker\ for interactive tenant shells. The \tenants:link\ command now supports removing symlinks, and \tenants:install\ has been rewritten to use a structured step-based installer. Additionally, \tenants:migrate-fresh\ now optionally drops tenant databases if configured, and \tenants:seed\ has been updated to support Laravel 13.24+ signature syntax.

src/Commands · high confidence

New contract interfaces for tenancy core components

The \src/Contracts\ directory now defines explicit interfaces for the library's core tenancy abstractions, including \Tenant\, \Domain\, \Feature\, \TenantResolver\, \UniqueIdentifierGenerator\, and \TenancyBootstrapper\. This change introduces a formal contract layer that standardizes how tenants are identified (via \getTenantKey\), how features are bootstrapped, and how unique IDs are generated, providing a clearer extension point for custom implementations.

src/Contracts · high confidence

New specific exceptions for tenant identification and validation errors

The library now introduces a suite of granular exception classes in the \Stancl\\Tenancy\\Exceptions\ namespace to provide clearer error reporting during tenant resolution. New exceptions include \DomainOccupiedByOtherTenantException\ and \NotASubdomainException\ for domain validation, \RouteIsMissingTenantParameterException\ for route configuration issues, and \StatefulGuardRequiredException\ for authentication guard constraints. Additionally, identification failures are now categorized by source with \TenantCouldNotBeIdentifiedByIdException\, \TenantCouldNotBeIdentifiedByPathException\, \TenantCouldNotBeIdentifiedByRequestDataException\, and \TenantCouldNotBeIdentifiedOnDomainException\, all extending \TenantCouldNotBeIdentifiedException\, alongside \TenantColumnNotWhitelistedException\ for database column restrictions and \TenancyNotInitializedException\ for general initialization states.

src/Exceptions · high confidence

New tenancy lifecycle listeners and queueable listener base class

The \src/Listeners\ directory now contains a set of new event listeners that manage the tenancy lifecycle and database connections. \BootstrapTenancy\ and \RevertToCentralContext\ handle the initialization and teardown of tenancy bootstrappers, ensuring they are only reverted if they were previously initialized. \CreateTenantConnection\ and \UseTenantConnection\ manage switching the database connection to the tenant context, while \UseCentralConnection\ reverts it to the central database. \ForgetTenantParameter\ cleans up the tenant parameter from route matches when using kernel-based path identification. Additionally, \CreateTenantStorage\ and \DeleteTenantStorage\ are introduced to manage tenant-specific storage directories, with \DeleteTenantStorage\ checking configuration to avoid accidental central storage deletion. A new \QueueableListener\ abstract class is provided to allow listeners to be optionally queued via a static \$shouldQueue\ flag.

src/Listeners · high confidence

Refactored RLS policy generation with comment-based constraints and new manager classes

The Row-Level Security (RLS) policy generation logic has been restructured into dedicated manager classes: TableRLSManager handles database schema analysis to generate policies based on foreign key paths, while TraitRLSManager discovers Eloquent models to generate policies based on traits like BelongsToTenant. A new RLSCommentConstraintException was added to handle malformed constraints, and the system now supports skipping foreign keys marked with a 'no-rls' comment, allowing users to explicitly exclude specific relationships from RLS scoping.

src/RLS/PolicyManagers · high confidence

Refactored database concerns into new traits and scope

The database concerns in this namespace have been reorganized into a set of new, focused traits and a scope class. This includes new traits for managing tenant relationships (BelongsToTenant, BelongsToPrimaryModel), database configuration and connections (HasDatabase, CentralConnection, TenantConnection), domain handling (HasDomains, ConvertsDomainsToLowercase, EnsuresDomainIsNotOccupied), and tenant lifecycle management (HasPending, MaintenanceMode, InitializationHelpers). Additionally, new traits handle specific operational concerns like generating IDs (GeneratesIds), filling current tenant context (FillsCurrentTenant), managing Postgres users (ManagesPostgresUsers, CreatesDatabaseUsers), validating database parameters (ValidatesDatabaseParameters), and invalidating resolver caches (InvalidatesResolverCache, InvalidatesTenantsResolverCache). A new PendingScope class manages query scoping for pending tenants, and an RLSModel interface is introduced for Row Level Security integration.

src/Database/Concerns · high confidence

Refactored database connection management and tenant scoping

The database layer has been restructured to improve how tenant connections are managed and how queries are scoped. A new DatabaseConfig class centralizes the logic for generating database names, usernames, and passwords, and now supports defining the tenant connection template using array syntax in the configuration. The DatabaseManager has been refactored to handle connection creation and purging more cleanly, ensuring the default connection switches correctly between central and tenant databases. Additionally, new global scopes (TenantScope and ParentModelScope) automatically filter queries by the current tenant or its parent model, with helper macros like withoutTenancy and withoutParentModel to bypass these filters when needed. A TenantCollection class was also added to allow running callbacks for multiple tenants at once.

src/Database · high confidence

Refactored tenancy core and expanded helper functions

The internal tenancy architecture has been refactored: the legacy TenantManager, DatabaseManager, and Tenant classes have been removed and replaced with a new stateful Tenancy class and dedicated exception types (e.g., DatabaseManagerNotRegisteredException, TenantDatabaseAlreadyExistsException). The TenancyServiceProvider now registers a broader set of commands (including Up, Down, Link, TenantDump, MigrateFresh, and impersonation token cleanup) and introduces a global cache binding for central-context caching. Additionally, the helper functions have been expanded to include tenant\_asset, global\_asset, global\_cache, tenant\_route, tenant\_channel, and global\_channel, providing more granular control over assets, caching, routing, and broadcasting in both tenant and central contexts.

src · high confidence

Refactored tenancy identification and session scoping middleware

The middleware layer has been restructured to support multiple tenant identification strategies (domain, subdomain, path, request data, and origin header) through a unified abstract base class, replacing the previous generic InitializeTenancy middleware. This change introduces specific middleware classes for each identification method, allowing users to choose how tenants are resolved. Additionally, the ScopeSessions middleware now enforces that tenancy is initialized before session scoping occurs, throwing an exception if the order is incorrect, and the PreventAccessFromUnwantedDomains middleware now correctly handles universal routes to prevent access mismatches between central and tenant contexts.

src/Middleware · high confidence

Refactored tenant database management interfaces

The tenant database management contracts have been restructured to improve separation of concerns and state management. A new \TenantDatabaseManager\ interface now handles core database lifecycle operations (create, delete, existence checks) and connection configuration. A separate \ManagesDatabaseUsers\ interface has been introduced to isolate user management tasks (create, delete, existence checks). Additionally, a \StatefulTenantDatabaseManager\ interface provides methods for getting and setting a persistent database connection, while the \TenantWithDatabase\ interface ensures tenants expose their database configuration. This change affects how database and user operations are abstracted for tenant-aware applications.

src/Database/Contracts · high confidence

Removal of default tenancy configuration file

The default configuration file for the tenancy package (\src/config/tenancy.php\) has been removed. This file previously defined default settings for storage drivers, database prefixes and suffixes, Redis and cache key prefixes, and filesystem disk suffixes. Users relying on these defaults will need to provide their own configuration or ensure the package is configured via other means, as the built-in fallback configuration is no longer present.

src/config · high confidence

Resource syncing listeners for central-tenant data synchronization

This change introduces a suite of event listeners in the ResourceSyncing module to manage data consistency between central and tenant databases. The new listeners handle creating tenant resources when central resources are attached, updating synced attributes across all tenants when a central record changes, and deleting tenant resources or pivot mappings when central resources are detached or deleted. It also includes logic to restore soft-deleted tenant resources when a central resource is restored, ensuring that the lifecycle of synced resources is properly mirrored across the tenancy architecture.

src/ResourceSyncing/Listeners · high confidence

Resource syncing rework with new pivot interfaces and event handling

The resource syncing mechanism has been restructured to improve how central resources are attached to tenants. A new \PivotWithCentralResource\ interface allows pivot models to explicitly define the central resource class, while \TenantMorphPivot\ and \TenantPivot\ now use the \TriggerSyncingEvents\ trait to handle attach/detach lifecycle events. The \ResourceSyncing\ trait introduces new events (\SyncedResourceDeleted\, \SyncMasterDeleted\, etc.) and enforces that central resources are accessed via the central model's \tenants()\ relationship, throwing \CentralResourceNotAvailableInPivotException\ if the pivot context is ambiguous or missing the central resource.

src/ResourceSyncing · high confidence

Tenant-aware URL generation and cache tagging

The package now automatically scopes cache operations and URL generation to the current tenant. A new CacheManager override ensures all cache calls are prefixed with the tenant key, preventing data leakage between tenants. Additionally, the TenancyUrlGenerator overrides Laravel's URL generation to automatically append the tenant parameter to routes (or prefix route names) when in a tenant context, ensuring generated links point to the correct tenant scope while allowing bypass via a specific parameter.

src/Overrides · high confidence

Updated tenancy scaffolding with new asset routing and stub defaults

The package's installation assets have been updated to reflect the current tenancy configuration. The new \TenancyServiceProvider.stub.php\ now includes event listeners for resource syncing (e.g., \SyncedResourceSaved\) and pending tenant events, while the \config.php\ defaults to domain-based identification and enables the database session bootstrapper. Additionally, a new \routes.php\ asset introduces a \TenantAssetController\ route for serving tenant assets, and the \tenant\_routes.stub.php\ now includes the \ScopeSessions\ middleware by default.

assets · high confidence

Test coverage

13 commits adding/updating tests in tests/RLS; Added comprehensive test coverage for tenancy bootstrappers; Added feature tests for tenancy configuration, security, and asset bundling; Added test fixtures and stubs for the tests/Etc directory; Added test migration for tenant users table; Comprehensive test suite for tenancy core features.

Housekeeping

Added FFI class stub for IDE support

A stub class for FFI has been added to the typedefs directory to provide Intelephense support. This change improves IDE autocomplete and type hinting for FFI-related code without altering runtime behavior.

typedefs · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 51.6 → 52.4 (+0.8)
  • Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 82.4 → 81.6 (-0.8)
  • Architecture 84.7 → 83.0 (-1.7)
  • Maturity 55.5 → 59.2 (+3.7)
  • Readiness 34.4 → 34.4 (0.0)
  • Security 74.5 → 74.5 (0.0)

Resolved (2)

  • Projects may be oversized for their cohesion
  • TodoComment (tests/RLS/PolicyTest.php)

New (22)

  • CheckTenantForMaintenanceMode.handle (cyclomatic 16) (src/Middleware/CheckTenantForMaintenanceMode.php)
  • Circular dependency (src/TenancyServiceProvider.php)
  • Edited copy of a member (10 corresponding lines) (src/Database/Concerns/BelongsToPrimaryModel.php)
  • Edited copy of a member (14 corresponding lines) (src/Bootstrappers/BroadcastingConfigBootstrapper.php)
  • Edited copy of a member (16 corresponding lines) (src/Bootstrappers/CacheTenancyBootstrapper.php)
  • Edited copy of a member (17 corresponding lines) (src/Database/TenantDatabaseManagers/PermissionControlledMicrosoftSQLServerDatabaseManager.php)
  • Edited copy of a member (24 corresponding lines) (src/Bootstrappers/PersistentQueueTenancyBootstrapper.php)
  • Edited copy of a member (29 corresponding lines) (src/Bootstrappers/BroadcastChannelPrefixBootstrapper.php)
  • Edited copy of a member (42 corresponding lines) (src/Commands/Migrate.php)
  • Edited copy of a member (7 corresponding lines) (src/Database/Concerns/BelongsToPrimaryModel.php)
  • Edited copy of a member (8 corresponding lines) (src/Actions/CreateStorageSymlinksAction.php)
  • Off the main sequence: src/Events
  • Off the main sequence: typedefs
  • Orphaned file (src/Concerns/UsableWithEarlyIdentification.php)
  • Orphaned file (src/Middleware/PreventAccessFromUnwantedDomains.php)
  • Projects may be oversized for their cohesion (composer.json)
  • TodoComment (tests/Bootstrappers/DatabaseTenancyBootstrapperTest.php)
  • TodoComment (tests/CommandsTest.php)
  • TodoComment (tests/RLS/PolicyTest.php)
  • TodoComment (tests/RLS/PolicyTest.php)
  • …and 2 more

Changes since last survey

  • 11 commits — 8 feature/other, 3 fixes

By area

  • src/Bootstrappers — 3 commits
  • (root) — 2 commits
  • tests/Etc — 2 commits
  • src/Commands — 1 commit
  • src/Database — 1 commit
  • src/Jobs — 1 commit
  • tests/TestCase.php — 1 commit

Notable commits

  • fix: Drop leftover databases before each test to fix MySQL error 1615
  • fix: maintenance mode: support rendering a view, minor fixes (#1523)
  • fix: tests: fix dynamodb secret env name for consistency
  • change: claude.md: add note about ARM symlink in workspaces
  • change: commands: add $scopeTenantsQuery (#1528)
  • change: database: support DB_URL, handle read/write/direct
  • change: phpstan: add ably ignore
  • change: rls: give RLS user credentials precedence over DB_URL
  • change: rls: set the session variable when each PDO connects (#1527)
  • change: tenant aware commands: keep Laravel's execute() behavior (#1521)
  • change: tenants:run: return exit code, write to the command's output (#1522)

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

archtechx/tenancy was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 17 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit c61c8523a9dccc4ad064ff20e02e2988bb729399 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.85+preprod-eba6548ac50f.