@php use App\Support\DocumentBrand; $settings = $businessSettings ?? []; ['brand' => $brand, 'brandDark' => $brandDark] = DocumentBrand::colors($settings); $logoPath = DocumentBrand::logoPath($settings['business_logo'] ?? null); $rows = collect($rows)->map(fn ($row) => array_values((array) $row)); $columns = count($headers); // A column is numeric when every non-empty cell in it looks like a number // (with or without thousands separators). Those columns are right-aligned so // amounts line up; text columns stay left. $numeric = []; foreach (range(0, max($columns - 1, 0)) as $i) { $cells = $rows->pluck($i)->filter(fn ($v) => $v !== null && $v !== '' && $v !== '-'); $numeric[$i] = $cells->isNotEmpty() && $cells->every(fn ($v) => is_numeric(str_replace([',', ' '], '', (string) $v))); } $filterLabels = collect($filters ?? []) ->filter(fn ($v) => $v !== null && $v !== '' && $v !== []) ->map(fn ($v, $k) => ucfirst(str_replace('_', ' ', $k)).': '.(is_array($v) ? implode(', ', $v) : $v)); @endphp
| {{ $settings['business_name'] ?? '' }} · {{ $title }} · generated {{ now()->format('d M Y, H:i') }} | Page |
|
@if ($logoPath)
{{ $settings['business_name'] }} @endif @if (!empty($settings['business_address'])){{ $settings['business_address'] }} @endif @if (!empty($settings['business_phone']) || !empty($settings['business_email'])){{ collect([$settings['business_phone'] ?? null, $settings['business_email'] ?? null])->filter()->implode(' · ') }} @endif |
{{ strtoupper($title) }} Generated {{ now()->format('d M Y, H:i') }} · {{ $rows->count() }} {{ \Illuminate\Support\Str::plural('row', $rows->count()) }} |
|
Filters applied: {{ $filterLabels->implode(' · ') }}
|
| {{ strtoupper($h) }} | @endforeach
|---|
| {{ $col === null || $col === '' ? '—' : $col }} | @endforeach
SUMMARY
|
|
{{ $settings['business_name'] ?? 'Report' }} · {{ $title }}
Figures reflect records in the system at the time of generation. Internal document. |