@extends('layouts.app')
@section('page-title', 'Transactions')
@push('styles')
@endpush
@section('content')
{{-- ========================================
PAGE HEADER
======================================== --}}
{{-- ========================================
SUMMARY CARDS
======================================== --}}
Total Income
৳{{ number_format($totalIncome, 2) }}
Total Expenses
৳{{ number_format($totalExpense, 2) }}
{{-- ========================================
FILTERS
======================================== --}}
{{-- ========================================
TRANSACTIONS TABLE (≥ 576px)
======================================== --}}
{{-- Desktop / tablet table --}}
| Date |
Type |
Amount |
Method |
Details |
Action |
@forelse($transactions as $transaction)
|
{{ $transaction->date->format('M d, Y') }}
|
@if($transaction->type == 'income')
@else
@endif
{{ ucfirst($transaction->type) }}
|
{{ $transaction->type == 'income' ? '+' : '−' }}৳{{ number_format($transaction->amount, 2) }}
|
@if($transaction->payment_method == 'cash')
@elseif($transaction->payment_method == 'bank')
@else
@endif
{{ ucfirst($transaction->payment_method) }}
|
{{ $transaction->details ?? '—' }}
|
|
@empty
|
|
@endforelse
{{-- Mobile card list (shown only on < 576px via CSS) --}}
@forelse($transactions as $transaction)
{{ $transaction->date->format('M d, Y') }}
{{ $transaction->details ?? '—' }}
{{ $transaction->type == 'income' ? '+' : '−' }}৳{{ number_format($transaction->amount, 2) }}
{{ ucfirst($transaction->type) }}
@if($transaction->payment_method == 'cash')
@elseif($transaction->payment_method == 'bank')
@else
@endif
{{ ucfirst($transaction->payment_method) }}
View
@empty
@endforelse
{{-- Pagination --}}
@if($transactions->hasPages())
@endif
@endsection