tenancy-docs/docs/source/v2/custom-database-names.blade.md
2019-09-23 18:08:49 -04:00

508 B

title description extends section
Custom Database Names Custom Database Names.. _layouts.documentation_v2 content

Custom Database Names

To use a specific database name for a tenant, set the _tenancy_db_name key in the tenant's storage.

You should do this during the tenant creation process, to make sure the database is created with the right name:

use Stancl\Tenancy\Tenant;

Tenant::create('example.com', [
    '_tenancy_db_name' => 'example_com'
])