mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 02:04:03 +00:00
update sail notes. (#189)
This commit is contained in:
parent
550e0f4383
commit
2769460a1a
2 changed files with 4 additions and 3 deletions
|
|
@ -60,7 +60,8 @@ The list of domains that host your [central app]({{ $page->link('the-two-applica
|
||||||
This config array lets you enable, disable or add your own [tenancy bootstrappers]({{ $page->link('tenancy-bootstrappers') }}).
|
This config array lets you enable, disable or add your own [tenancy bootstrappers]({{ $page->link('tenancy-bootstrappers') }}).
|
||||||
|
|
||||||
### Database {#database}
|
### Database {#database}
|
||||||
> Note: If you're using [Laravel Sail](https://laravel.com/docs/9.x/sail), ensure that `DB_USERNAME` has the necessary permissions to create databases. You can grant access to users by running `grant create on *.* to 'sail'@'%';` in the MySQL console.
|
> Note: If you're using [Laravel Sail](https://laravel.com/docs/9.x/sail), ensure that `DB_USERNAME` has the necessary permissions. You can grant privileges to users by running `GRANT ALL PRIVILEGES on *.* to 'sail'@'%';` in the MySQL console.
|
||||||
|
> Once you have finalized the permissions, always be sure to reload all the privileges `FLUSH PRIVILEGES;`
|
||||||
|
|
||||||
`tenancy.database.*`
|
`tenancy.database.*`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -177,8 +177,8 @@ Route::get('/', function () {
|
||||||
To have users in tenant databases, let's move the `users` table migration (the file `database/migrations/2014_10_12_000000_create_users_table.php` or similar) to `database/migrations/tenant`. This will prevent the table from being created in the central database, and it will be instead created in the tenant database when a tenant is created — thanks to our event setup.
|
To have users in tenant databases, let's move the `users` table migration (the file `database/migrations/2014_10_12_000000_create_users_table.php` or similar) to `database/migrations/tenant`. This will prevent the table from being created in the central database, and it will be instead created in the tenant database when a tenant is created — thanks to our event setup.
|
||||||
|
|
||||||
## Creating tenants {#creating-tenants}
|
## Creating tenants {#creating-tenants}
|
||||||
|
> Note: If you're using [Laravel Sail](https://laravel.com/docs/9.x/sail), ensure that `DB_USERNAME` has the necessary permissions. You can grant privileges to users by running `GRANT ALL PRIVILEGES on *.* to 'sail'@'%';` in the MySQL console.
|
||||||
> Note: If you're using [Laravel Sail](https://laravel.com/docs/9.x/sail), ensure that `DB_USERNAME` has the necessary permissions to create databases. You can grant access to users by running `grant create on *.* to 'sail'@'%';` in the MySQL console.
|
> Once you have finalized the permissions, always be sure to reload all the privileges `FLUSH PRIVILEGES;`
|
||||||
|
|
||||||
For testing purposes, we'll create a tenant in `tinker` — no need to waste time creating controllers and views for now.
|
For testing purposes, we'll create a tenant in `tinker` — no need to waste time creating controllers and views for now.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue