currentPolicy->limit_balance; $myLimitTotal = (int)$this->currentPolicy->total_premi; return [ 'companyName' => $this->name, 'policyNumber' => $this->currentPolicy->code, 'totalMembers' => $this->employees_count, 'totalCases' => $this->claims_count, 'myLimit' => [ 'balance' => $myLimitBalance, 'total' => $myLimitTotal, 'percentage' => $myLimitTotal ? round(($myLimitBalance / $myLimitTotal) * 100, 2) : 0, ], 'maxTopUp' => ($myLimitTotal - $myLimitBalance) ]; } }