Apply suggestions from code review

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
This commit is contained in:
lukinovec 2022-06-06 12:03:58 +02:00 committed by GitHub
parent 30ce005ffb
commit c518e7abed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,12 +59,12 @@ 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 column will be stored in the `data` JSON column. You can set these attributes as you'd normally set model attributes: Attributes of the tenant model which don't have their own column will be stored in the `data` JSON column. You can set these attributes like you'd set normal model attributes:
```php ```php
$tenant->update([ $tenant->update([
'attributeThatHasNoColumn' => 'value', // stored in the `data` JSON column 'attributeThatHasNoColumn' => 'value', // stored in the `data` JSON column
'plan' => 'free' // stored in the `plan` column (see below) 'plan' => 'free' // stored in the dedicated `plan` column (see below)
]); ]);
``` ```
or or
@ -74,7 +74,7 @@ $tenant->plan = 'free'; // stored in the `plan` column (see below)
$tenant->save(); $tenant->save();
``` ```
You may define the custom columns that **won't** be stored in the `data` JSON column by overriding the `getCustomColumns()` method on your `Tenant` model: You may define the custom columns (that **won't** be stored in the `data` JSON column) by overriding the `getCustomColumns()` method on your `Tenant` model:
```php ```php
public static function getCustomColumns(): array public static function getCustomColumns(): array