Skip to content

DatabaseTenancyBootstrapper

The DatabaseTenancyBootstrapper handles connecting to the tenant database when tenancy is initialized. This bootstrapper is used with multi-database tenancy.

It works by:

  • Creating a new connection named tenant
  • Changing the default database connection to tenant

This means you can still interact with your central connection by referencing it explicitly, rather than having Laravel use the default connection. On models, you can use the CentralConnection trait for this.