diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 39f9808cbe..c273b87a59 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -463,8 +463,8 @@ class CheckData extends Command $contact = $contact_class::where('company_id', $entity->company_id)->where($client_vendor_key,$entity->{$client_vendor_key})->first(); //double check if an archived invite exists - if($contact && $entity->invitations()->withTrashed()->where($contact_id, $contact->id)->count() != 0) { - $i = $entity->invitations()->withTrashed()->where($contact_id, $contact->id)->first(); + if($contact && $entity_obj::withTrashed()->where($entity_key, $entity->id)->where($contact_id, $contact->id)->count() != 0) { + $i = $entity_obj::withTrashed()->where($entity_key, $entity->id)->where($contact_id, $contact->id)->first(); $i->restore(); $this->logMessage("Found a valid contact and invitation restoring for {$entity_key} - {$entity->id}"); } diff --git a/app/Jobs/Entity/CreateEntityPdf.php b/app/Jobs/Entity/CreateEntityPdf.php index 3e237ac824..6c12b1c1ec 100644 --- a/app/Jobs/Entity/CreateEntityPdf.php +++ b/app/Jobs/Entity/CreateEntityPdf.php @@ -1,5 +1,4 @@