Merge branch 'master' of github.com:stancl/tenancy-docs

This commit is contained in:
Samuel Štancl 2019-09-30 18:56:21 +02:00
commit ebebb21809
12 changed files with 50 additions and 35 deletions

View file

@ -11,7 +11,7 @@ This page documents a couple of `TenantManager` methods you may find useful.
To call methods on `TenantManager`, you may use the `tenancy()` helper or the `Tenancy` facade.
### Finding tenant using id
### Find tenant by id
```php
>>> \Tenancy::find('b07aa3b0-dc68-11e9-9352-9159b2055c42')
@ -26,9 +26,8 @@ To call methods on `TenantManager`, you may use the `tenancy()` helper or the `T
}
```
### Finding tenant by domain
### Find tenant by domain
You may use the second argument to specify the key(s) as a string/array.
```php
>>> tenancy()->findByDomain('bar.localhost')
@ -112,11 +111,13 @@ This method returns a collection of arrays.
=> true
```
This doesn't delete the tenant's database. If you want to delete it, save the database name prior to deleting the tenant. You can get the database name using `getDatabaseName()`
NOTE: This doesn't delete the tenant's database.
If you want to delete it, get the database name prior to deleting the tenant using `getDatabaseName()`.
```php
>>> $tenant->getDatabaseName()
=> "tenant67412a60-1c01-11e9-a9e9-f799baa56fd9"
```
If you want tenant databases to be deleted automatically, you may use the [`delete_database_after_tenant_deletion` configuration]({{ $page->link('configuration#delete-database-after-tenant-deletion') }})
If you want tenant databases to be deleted automatically, you may use the [`delete_database_after_tenant_deletion` configuration]({{ $page->link('configuration#delete-database-after-tenant-deletion') }})