@extends('layouts.app') @section('title', 'Dashboard ยท SakuApp') @section('page-title', 'Dashboard') @section('content') {{-- Stat Cards --}}
Total Income
{{ number_format($totalIncome, 2) }}
Total Expenses
{{ number_format($totalExpense, 2) }}
Current Balance
{{ number_format($balance, 2) }}
{{-- Monthly + Yearly --}}

Monthly โ€” {{ now()->year }}

@if ($monthlySummary->isEmpty())
๐Ÿ“…

No data for {{ now()->year }}

@else @foreach ($monthlySummary as $row) @php $net = $row->income - $row->expense; @endphp @endforeach
Month Income Expense Net
{{ DateTime::createFromFormat('!m', (int) $row->month)->format('M') }} {{ number_format($row->income, 2) }} {{ number_format($row->expense, 2) }} {{ number_format($net, 2) }}
@endif

Yearly Summary

@if ($yearlySummary->isEmpty())
๐Ÿ“Š

No yearly data yet

@else @foreach ($yearlySummary as $row) @php $net = $row->income - $row->expense; @endphp @endforeach
Year Income Expense Net
{{ (int) $row->year }} {{ number_format($row->income, 2) }} {{ number_format($row->expense, 2) }} {{ number_format($net, 2) }}
@endif
{{-- Recent Transactions --}}

Recent Transactions

New
@if ($latestTransactions->isEmpty())
๐Ÿ’ธ

No transactions yet

Record your first income or expense to get started.

Add Transaction
@else @foreach ($latestTransactions as $txn) @endforeach
Date Description Type Amount Note
{{ $txn->date->format('d M Y') }} {{ $txn->title }} {{ ucfirst($txn->type) }} {{ number_format($txn->amount, 2) }} {{ $txn->note ? Str::limit($txn->note, 38) : 'โ€”' }}
@endif
@if ($latestTransactions->hasPages())
@foreach ($latestTransactions->getUrlRange(1, $latestTransactions->lastPage()) as $page => $url) @if ($page == $latestTransactions->currentPage()) {{ $page }} @else {{ $page }} @endif @endforeach
@endif
@endsection