mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
document more features
This commit is contained in:
parent
34a6b2cadd
commit
be8d1fa497
2 changed files with 15 additions and 2 deletions
|
|
@ -28,7 +28,6 @@ To call methods on `TenantManager`, you may use the `tenancy()` helper or the `T
|
||||||
|
|
||||||
### Find tenant by domain
|
### Find tenant by domain
|
||||||
|
|
||||||
|
|
||||||
```php
|
```php
|
||||||
>>> tenancy()->findByDomain('bar.localhost')
|
>>> tenancy()->findByDomain('bar.localhost')
|
||||||
=> Stancl\Tenancy\Tenant {#3091
|
=> Stancl\Tenancy\Tenant {#3091
|
||||||
|
|
@ -41,6 +40,14 @@ To call methods on `TenantManager`, you may use the `tenancy()` helper or the `T
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Find tenant by arbitrary key
|
||||||
|
|
||||||
|
> Note: Only the DB storage driver implements this feature.
|
||||||
|
```php
|
||||||
|
tenancy()->findBy('email', $email);
|
||||||
|
tenancy()->findByEmail($email);
|
||||||
|
```
|
||||||
|
|
||||||
### Getting the current tenant
|
### Getting the current tenant
|
||||||
|
|
||||||
One more way to get the current [tenant]({{ $page->link('tenants') }}) is to call `getTenant()` on `TenantManager`:
|
One more way to get the current [tenant]({{ $page->link('tenants') }}) is to call `getTenant()` on `TenantManager`:
|
||||||
|
|
|
||||||
|
|
@ -46,4 +46,10 @@ Note that $key has to be a string or an array with string keys. The value(s) can
|
||||||
"a" => "b",
|
"a" => "b",
|
||||||
"c" => "d",
|
"c" => "d",
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To delete keys from the storage, you may use these methods:
|
||||||
|
```php
|
||||||
|
$tenant->deleteKey($key)
|
||||||
|
$tenant->deleteKeys(['foo', 'bar']);
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue