@php($riwayat = \App\Models\SalaryTransaction::with('admin')->where('user_id', $userId)->latest()->take(10)->get()) @if ($riwayat->isEmpty())

Belum ada riwayat transaksi.

@else
@foreach ($riwayat as $r)
{{ $r->type === 'earn' ? '+' : '-' }} Rp {{ number_format($r->amount, 0, ',', '.') }}
{{ $r->description }}
{{ $r->created_at->translatedFormat('d M Y') }}
oleh {{ $r->admin->name }}
@endforeach
@endif