invoicePdf !== null && $this->invoicePdfFileName !== null) { return [ Attachment::fromData(fn () => $this->invoicePdf, $this->invoicePdfFileName) ->withMime('application/pdf'), ]; } return []; } protected function scenario(): string { return 'vm_credentials'; } protected function variables(): array { $data = [...MailGlobals::values(), ...$this->data]; $row = fn (string $label, ?string $value) => $value ? EmailTemplateShell::row($label, e($value)) : ''; return [ 'app_name' => $data['company_name'] ?? config('app.name', 'The Gioi So'), 'full_name' => $data['client_name'] ?? 'Quý khách', 'product_name' => $data['product_name'] ?? 'Cloud VPS', 'product_billing_row' => $row('Chu kỳ thanh toán', $data['product_billing'] ?? null), 'product_price_row' => $row('Giá dịch vụ', !empty($data['product_price']) ? $data['product_price'] . ' VNĐ' : null), 'os_name_row' => $row('Hệ điều hành', $data['os_name'] ?? null), 'service_host' => $data['service_host'] ?? '', 'service_username' => $data['service_username'] ?? '', 'service_password' => $data['service_password'] ?? '', 'service_port_row' => $row('Cổng kết nối', $data['service_port'] ?? null), 'service_due_exp_row' => $row('Hạn sử dụng', $data['service_due_exp'] ?? null), ]; } }