mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 16:34:04 +00:00
Prevent missing and duplicate field
The documentation says a custom column needs to be declared in getCustomColumns function, that include 'id' (per default in Virtual Column package), 'created_at', 'updated_at'. If 'created_at', 'updated_at' are not declare, the make a empty 'created_at' field and duplicate 'update_at' field, when created a tenant.
This commit is contained in:
parent
20e1fa1959
commit
3f1b8d2a6e
1 changed files with 9 additions and 0 deletions
|
|
@ -47,6 +47,15 @@ class Tenant extends Model implements Contracts\Tenant
|
||||||
return new TenantCollection($models);
|
return new TenantCollection($models);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getCustomColumns(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'id',
|
||||||
|
'created_at',
|
||||||
|
'updated_at',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
protected $dispatchesEvents = [
|
protected $dispatchesEvents = [
|
||||||
'saving' => Events\SavingTenant::class,
|
'saving' => Events\SavingTenant::class,
|
||||||
'saved' => Events\TenantSaved::class,
|
'saved' => Events\TenantSaved::class,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue