This commit is contained in:
Samuel Štancl 2022-01-06 16:52:25 +01:00 committed by GitHub
parent 9003b7ab16
commit 3c4bda178f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,6 +51,8 @@ Note that you don't want to grant the users the ability to grant themselves more
## Specifying template connections {#specifying-the-template-connections} ## Specifying template connections {#specifying-the-template-connections}
> **Important:** there should be no `tenant` connection in `config/database.php`. If you create a template connection for tenants, name it something like `tenant_template`. The `tenant` connection is entirely managed by the package and gets reset to `null` when tenancy is ended.
To specify the connection that should be used to construct this tenant's database connection (the array like you'd find in `config/database.php`, set the `tenancy_db_connection` key. Otherwise, the connection whose name is in the `tenancy.database.template_connection` config will be used. If that key is null, the central connection will be used. To specify the connection that should be used to construct this tenant's database connection (the array like you'd find in `config/database.php`, set the `tenancy_db_connection` key. Otherwise, the connection whose name is in the `tenancy.database.template_connection` config will be used. If that key is null, the central connection will be used.
## Specifying other connection details {#specifyng-other-connection-details} ## Specifying other connection details {#specifyng-other-connection-details}
@ -62,4 +64,4 @@ You may also set specific connection details without necessarily creating a new
- optionally, the username and password - optionally, the username and password
- all `tenancy_db_*` keys - all `tenancy_db_*` keys
This means that you can store a value for e.g. `tenancy_db_charset` if you want to specify the charset for the tenant's database connection for whatever reason. This means that you can store a value for e.g. `tenancy_db_charset` if you want to specify the charset for the tenant's database connection for whatever reason.