memberPlans?->first(); $data = [ 'member_id' => $this->member_id, 'birth_date' => $this->birth_date, 'email' => $this->email, 'phone' => $this->person->phone ?? null, 'full_name' => $this->full_name, 'nric' => $this->nric, 'plan' => $currentMemberPlan ? [ 'code' => $currentMemberPlan->plan->code ?? null, 'start' => $currentMemberPlan->start, 'end' => $currentMemberPlan->end, 'limit' => $this->currentPlan->limit_rules ] : null, 'policy_code' => $this->currentPolicy?->code ?? null, 'corporate' => [ 'code' => $this->currentPolicy?->corporate->code ?? null, 'name' => $this->currentPolicy?->corporate->name, 'welcome_message' => $this->currentPolicy?->corporate->welcome_message, 'help_text' => $this->currentPolicy?->corporate?->help_text, 'avatar_url' => $this->currentpolicy?->corporate?->avatar_url ], 'limit_usage' => $this->totalUsage ?? null ]; return $data; } }