From 3f1b8d2a6ec6337f66f3bb415d6b22ceda3ed6e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Manuel=20Casani=20Guerra?= Date: Tue, 28 Sep 2021 23:39:38 -0500 Subject: [PATCH] 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. --- src/Database/Models/Tenant.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Database/Models/Tenant.php b/src/Database/Models/Tenant.php index 4ec685b7..37f7a29f 100644 --- a/src/Database/Models/Tenant.php +++ b/src/Database/Models/Tenant.php @@ -46,6 +46,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,