mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
Improve tenants doc
This commit is contained in:
parent
f3f016faa6
commit
40160b2aff
1 changed files with 6 additions and 6 deletions
|
|
@ -59,18 +59,18 @@ After the tenant is created, an event will be fired. This will result in things
|
||||||
|
|
||||||
## Custom columns {#custom-columns}
|
## Custom columns {#custom-columns}
|
||||||
|
|
||||||
Attributes of the tenant model which don't have their own column will be stored in the `data` JSON column. You can set a custom attribute as you normally would set a models atribute:
|
Attributes of the tenant model which don't have their column will be stored in the `data` JSON column. You can set these attributes as you'd normally set model attributes:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$tenant->update([
|
$tenant->update([
|
||||||
'customAttribute' => 'value', // to be store in the `data` JSON column
|
'attributeThatHasNoColumn' => 'value', // stored in the `data` JSON column
|
||||||
'plan' => 'free' // to be stored in the plan column (see below)
|
'plan' => 'free' // stored in the `plan` column (see below)
|
||||||
]);
|
]);
|
||||||
```
|
```
|
||||||
or simply
|
or
|
||||||
```php
|
```php
|
||||||
$tenant->customAttribute = 'value'; // to be store in the `data` JSON column
|
$tenant->customAttribute = 'value'; // stored in the `data` JSON column
|
||||||
$tenant->plan = 'free'; // to be stored in the plan column (see below)
|
$tenant->plan = 'free'; // stored in the `plan` column (see below)
|
||||||
$tenant->save();
|
$tenant->save();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue