Getting Started
Introduction
laravel-go-tenancy adds multi-tenancy to Laravel Go applications.
It supports:
- Multi-database tenancy (default): each tenant has its own database
- Single-database tenancy (opt-in): shared schema with
fail-closed
tenant_idscoping
The package is built around three ideas:
- Identify a tenant from the HTTP request (domain, path, header, …)
- Initialize a request-scoped context for that tenant
- Bootstrap Laravel concerns (database, cache, filesystem, queue, session) so application code stays mostly unaware of tenancy
Unlike PHP runtimes that often mutate process-global state, this package stores
the current tenant and connection on context.Context. That matches Laravel for
Go’s context-first database and service APIs and stays safe under concurrent
requests.