bug fix in clients show view
This commit is contained in:
16
scratch.md
16
scratch.md
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user