1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 16:14:03 +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:
José Manuel Casani Guerra 2021-09-28 23:39:38 -05:00 committed by GitHub
parent 20e1fa1959
commit 3f1b8d2a6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,6 +47,15 @@ class Tenant extends Model implements Contracts\Tenant
return new TenantCollection($models);
}
public static function getCustomColumns(): array
{
return [
'id',
'created_at',
'updated_at',
];
}
protected $dispatchesEvents = [
'saving' => Events\SavingTenant::class,
'saved' => Events\TenantSaved::class,