switchToDefault() on TracksCurrentTenant — switches the user to their first accessible tenant, or clears the preference if none existURL::defaults() in IdentifyTenant middleware — route() helper now auto-fills the tenant parameter without manual passingdefaultLandingTenant() improved with method_exists duck-typing — users who forget to override get a sensible default from tenants()->first() instead of a hard crashRedirectToCurrentTenant no longer causes an infinite redirect loop when applied to the landing route itselftenant() migration macro — the foreign key already creates onetenancy:install now shows vendor:publish output for better install feedbackPatch release with internal housekeeping improvements.
TenantColumnTest from Unit to Feature test suite where it belongs (test uses app container via config())TestCase + RefreshDatabase for Feature tests only, TestCase alone for Architecture testsFirst public release of Laravel Tenancy — single-database multi-tenancy for Laravel that fails closed.
BelongsToTenant adds global scope, auto-stamps on create, guards mass assignment, rejects cross-tenant writes, and seals the foreign key — all in one use statement.tenancy:audit checks your database for missing traits, non-composite unique indexes, column type mismatches, and missing foreign keys. Run it in CI to catch isolation bugs before they reach production.assertTenantIsolated() verifies read isolation, write rejection, and missing-context behavior in a single call. actingAsTenant() sets up context the way actingAs() sets up auth.scoped(). No static state in the request path.TenancyManager and Tenancy facade with initialize(), end(), runFor(), each(), crossTenant()BelongsToTenant trait with withoutTenancy(), acrossTenants(), forTenant() scopes$table->tenant() migration macro with automatic type inferencetenant, tenant.required, tenant.member, tenant.record, tenant.landing, tenant.strict-switchtenancy:run command and InteractsWithTenants trait for consoleCache::tenant() decorator for tenant-scoped cachingtenancy:install scaffolding and tenancy:audit schema checksThis is a pre-release. The API is expected to stabilize for v1.0.0 after a production soak period. Feedback and bug reports are welcome via GitHub Issues.
How can I help you explore Laravel packages today?