soft deleting tenants

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

View file

@ -94,7 +94,7 @@ This method returns a collection of arrays.
}
```
### Deleting a tenant
### Deleting a tenant {#deleting-a-tenant}
```php
>>> $tenant = tenancy()->findByDomain('foo.localhost');
@ -121,3 +121,13 @@ If you want to delete it, get the database name prior to deleting the tenant usi
```
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') }})
### Soft deleting a tenant {#soft-deleting-a-tenant}
You may also "soft delete" tenants. The `softDelete()` method detaches all domains from a tenant:
```php
$tenant->softDelete();
```
The list of original domains will be accessible under the `_tenancy_original_domains` key in the tenant storage.