document more features

This commit is contained in:
Samuel Štancl 2019-11-10 15:09:01 +01:00
parent 34a6b2cadd
commit be8d1fa497
2 changed files with 15 additions and 2 deletions

View file

@ -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`:

View file

@ -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']);
```