diff --git a/app/Services/Recurring/CreateRecurringInvitations.php b/app/Services/Recurring/CreateRecurringInvitations.php index fa06976eba..0aec0a0eaf 100644 --- a/app/Services/Recurring/CreateRecurringInvitations.php +++ b/app/Services/Recurring/CreateRecurringInvitations.php @@ -63,6 +63,19 @@ class CreateRecurringInvitations extends AbstractService info($e->getMessage()); } + if ($this->entity->invitations()->count() == 0) { + + $invitation = $this->invitation_class::where('company_id', $this->entity->company_id) + ->where($this->entity_id_name, $this->entity->id) + ->withTrashed() + ->first(); + + if ($invitation) + $invitation->restore(); + + } + + return $this->entity; } }