tenancy-docs/docs/source/v2/custom-database-names.blade.md
2019-09-23 17:22:37 -04:00

20 lines
512 B
Markdown

---
title: Custom Database Names
description: Custom Database Names..
extends: _layouts.documentation_v2
section: content
---
# Custom Database Names {#custom-database-names}
To set a specific database name for a tenant, specify 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:
```php
use Stancl\Tenancy\Tenant;
Tenant::create('example.com', [
'_tenancy_db_name' => 'example_com'
])
```