@php $fieldMap = [ 'name' => 'Tên khách hàng', 'email' => 'Email', 'address' => 'Địa chỉ', ]; $rows = collect($fields ?? array_keys($fieldMap))->filter(fn($key) => isset($fieldMap[$key]))->values(); $propertyMap = ['name' => 'fullname', 'email' => 'email', 'address' => 'address']; @endphp @if($customer)
THÔNG TIN KHÁCH HÀNG
| {{ $fieldMap[$key] }}: | {{ $customer->{$propertyMap[$key]} ?? '—' }} |