bug fix in clients show view

This commit is contained in:
Kwesi Banson Jnr
2026-08-27 16:02:42 +00:00
parent f3d79367df
commit ff7f1e35e6
3 changed files with 2578 additions and 2 deletions

View File

@@ -84,4 +84,20 @@
<div>{!! renderBadges($showclient->support_phones, 'phone') !!}</div>
@endif
</div>
@php
function renderBadges($items, $type = 'email') {
if(gettype($items) == 'string') return '<span class="text-muted small">'.$items.'</span>';
elseif(count($items) === 0) return '<span class="text-muted small">N/A</span>';
$html = '';
foreach($items as $item) {
$icon = $type == 'email' ? 'bi-envelope' : 'bi-telephone';
$html .= '<span class="badge bg-light text-dark border me-1 mb-1"><i class="bi '.$icon.' text-secondary me-1"></i>'.$item.'</span>';
}
return $html;
}
@endphp