@foreach ($saldo_transactions as $saldo_transaction) @php $wallet_customer = $saldo_transaction->wallet; $customer = $wallet_customer->customer ?? '-'; $tabungan = optional( optional( optional($wallet_customer)->customer )->tabungan )->first(); @endphp @php $original = strtolower($customer->name ?? '-'); $words = explode(' ', $original); $maskedWords = []; foreach ($words as $index => $word) { $len = strlen($word); if ($len <= 2) { $maskedWords[] = $word; } else { if ($index === 0) { $firstChar = strtoupper(substr($word, 0, 1)); $masked = $firstChar . str_repeat('*', $len - 1); $maskedWords[] = $masked; } else { $lastChar = substr($word, -1); $masked = str_repeat('*', $len - 1) . $lastChar; $maskedWords[] = $masked; } } } $maskedName = implode(' ', $maskedWords); @endphp @endforeach
No Transaction Date Type SO Payment Method Invoice Customer Name GR Referral Status Transaksi Total qty Total Emas Total Transaksi Action
{{ optional(\Carbon\Carbon::parse($saldo_transaction->created_at ?? ''))->format('d/m/Y') }} {{ $saldo_transaction->code ?? '-' }} {{ $customer->code ?? '-'}}{{ $maskedName ?? '-' }} {{ optional(\Carbon\Carbon::parse($customer->created_at ?? ''))->format('d/m/Y') }} {{ $tabungan->nomor_rekening ?? '-'}} {{ number_format($saldo_transaction->nominal,2) }} @if(in_array($saldo_transaction->type, [2, 7, 11, 13])) DB @elseif(in_array($saldo_transaction->type, [5, 12])) CR @endif {{ $saldo_transaction->saldo_akhir ? number_format($saldo_transaction->saldo_akhir, 2, ',', '.') : '-' }} {{ $saldo_transaction->transaksi_type->type_name}}