@extends('layouts.app')
@section('title', $title ?? 'Report')
@section('content')
{{ $title }}
@if (!empty($subtitle))
{{ $subtitle }}
@endif
{{-- Common filter bar --}}
{{-- Results --}}
@if (empty($columns) || empty($rows))
No data for the selected filters.
@else
@foreach ($rows as $row)
@foreach ($columns as $key => $label)
@php
$field = is_string($key) ? $key : strtolower(str_replace(' ', '_', $label));
$val = is_array($row) ? ($row[$field] ?? '—') : ($row->$field ?? '—');
@endphp
| {{ is_numeric($val) ? number_format($val, str_contains((string) $val, '.') ? 2 : 0) : $val }} |
@endforeach
@endforeach
@if (!empty($totals))
@foreach ($columns as $key => $label)
@php $field = is_string($key) ? $key : strtolower(str_replace(' ', '_', $label)); @endphp
| {{ $totals[$field] ?? '' }} |
@endforeach
@endif
@endif
@if (!empty($notes))
{{ $notes }}
@endif
@endsection