@extends('layouts.app')
@section('title', 'Expenses')
@section('content')
@php
$pills = filter_pills([
'category_id' => ['Category', fn ($id) => optional($categories->firstWhere('id', $id))->name ?? $id],
'method' => ['Method', \App\Models\Payment::METHODS],
'from' => ['From', fn ($d) => pretty_date($d)],
'to' => ['To', fn ($d) => pretty_date($d)],
]);
$filtered = count($pills) > 0 || request()->filled('q');
@endphp
| Description | Actions | |||||
|---|---|---|---|---|---|---|
| {{ $e->expense_date->format('d M Y') }} | {{ $e->category->name }} | {{ $e->paid_to ?: '—' }} | {{ $e->description ?: '—' }}@if ($e->reference)Ref {{ $e->reference }}@endif | {{ \App\Models\Payment::METHODS[$e->method] ?? $e->method }} | {{ money($e->amount) }} |
|
|
| ||||||