@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 @can('expense_categories.manage') Categories @endcan @can('data.export') Export @endcan @can('expenses.create') Add expense @endcan
{{ $filtered ? 'Total (matching filters)' : 'Total expenses' }}
{{ money($total) }}
{{ $count }} {{ \Illuminate\Support\Str::plural('entry', $count) }}
@forelse ($expenses as $e) @empty @endforelse
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) }} @can('expenses.edit')
  • Edit
  • @endcan @can('expenses.delete')
  • @endcan
    @can('expenses.create') Add an expense @endcan
    @endsection