add note about a dedicated central conn being recommended

This commit is contained in:
Samuel Štancl 2019-10-11 20:12:11 +02:00
parent c487c4f65c
commit c34e9780a6
2 changed files with 4 additions and 2 deletions

View file

@ -9,7 +9,7 @@ section: content
The `config/tenancy.php` file lets you configure how the package behaves. The `config/tenancy.php` file lets you configure how the package behaves.
> **Note:** If the `tenancy.php` file doesn't exist in your `config` directory, you can publish it by running `php artisan vendor:publish --provider='Stancl\Tenancy\TenancyServiceProvider' --tag=config` > If the `tenancy.php` file doesn't exist in your `config` directory, you can publish it by running `php artisan vendor:publish --provider='Stancl\Tenancy\TenancyServiceProvider' --tag=config`
### `storage_driver, storage` {#storage} ### `storage_driver, storage` {#storage}

View file

@ -17,7 +17,9 @@ The database storage driver lets you store tenant information in a relational da
The benefit of this storage driver is that you don't have to use both Redis and a database for your data. Also you don't have to do as much configuration. The benefit of this storage driver is that you don't have to use both Redis and a database for your data. Also you don't have to do as much configuration.
To use this driver, you need to have a `tenants` table and a `domains` table. You may also use a custom database connection. By default, `tenancy.storage.db.connection` is set to `null`, which means that your app's default database connection will be used to store tenants. If you wish to use a different connection, you may create it in the `config/database.php` file and set `tenancy.storage.db.connection` to the name of that connection. To use this driver, you need to have a `tenants` table and a `domains` table. You may also use a custom database connection. By default, `tenancy.storage.db.connection` is set to `null`, which means that your app's default database connection will be used to store tenants.
If you wish to use a different connection, e.g. `central`, you may create it in the `config/database.php` file and set `tenancy.storage.db.connection` to the name of that connection. It's recommended to do this for easier changes in the future.
To create the `tenants` and `domains` tables, you can use the migrations that come with this package. If you haven't published them during installation, publish them now: To create the `tenants` and `domains` tables, you can use the migrations that come with this package. If you haven't published them during installation, publish them now:
``` ```