@extends('admin.layout') @section('title', 'Dashboard') @section('page-title', 'Dashboard') @section('page-icon', 'speedometer2') @section('content') @php $curMonth = DateTime::createFromFormat('!m', $month)->format('F') . ' ' . $year; @endphp {{-- Total spending card --}}
Total PPC Spending — {{ $curMonth }}
${{ number_format($totalSpending, 2) }}
Teams Tracked
{{ $teams->count() }}
Teams with Spending
{{ $teams->where('month_spending', '>', 0)->count() }}
{{-- Per-team spending cards --}}
@forelse($teams as $team)
{{ $team->name }}
{{ $team->company?->name ?? '—' }}
@if($team->month_spending > 0) ${{ number_format($team->month_spending, 0) }} @else No spending @endif
@if($totalSpending > 0 && $team->month_spending > 0) @php $pct = round(($team->month_spending / $totalSpending) * 100, 1); @endphp
{{ $pct }}% of total
@endif
@empty
No teams found.
@endforelse
{{-- My recent entries --}}
My Recent Entries View All
@forelse($recentSpendings as $entry) @empty @endforelse
Date Team Notes Amount
{{ $entry->created_at->format('d M Y') }} {{ $entry->team?->name ?? '-' }} {{ $entry->notes ?: '-' }} ${{ number_format($entry->amount, 2) }}
No entries yet.
@endsection