Frontend and UI – Analytics & Dashboards

This section covers the Blade views and UI components that render operational metrics and dashboards for Prep Network events. These interfaces ground decisions in event performance data by displaying charts, tables, and key figures directly within the Laravel backend.

🎯 Purpose

  • Provide at-a-glance metrics (e.g., total attendees, revenue).
  • Visualize trends with Chart.js line and bar charts.
  • Surface drop-off reasons and other detailed breakdowns.
  • Enable dynamic report toggles between showcases and tournaments.

Dashboard Structure

The main entry point is the Admin Dashboard view. It offers a toggle between Showcase and Tournament reports and loads the relevant partials via AJAX.

@extends('layouts.backend')

@section('content')
  <x-block title="Choose a Report:" class="mb-2">
    <div id="showcase-or-tournament-toggle" class="flex">
      <!-- Toggle Buttons -->
    </div>
    <div id="report-loading" class="invisible">…</div>
  </x-block>

  <div id="current-dashboard-report"></div>
@endsection
  • Toggle Logic: JavaScript listens for changes on the radio buttons and fetches /showcase-report or /tournament-report dynamically .
  • Report Container: Loaded content is injected into #current-dashboard-report.

🚀 Metric Blocks

Metric blocks display single values in a responsive grid. They use the <x-metric-block> component for consistent styling.

File: resources/views/dashboard/events/partials/metrics/showcase-orders.blade.php

<div class="grid lg:grid-cols-3 gap-4">
  <x-metric-block>
    <x-slot name="title">Total Attendees</x-slot>
    <x-slot name="value">
      <span class="text-gray-900">{{ $event->attendees()->count() }}</span>
    </x-slot>
  </x-metric-block>

  <x-metric-block>
    <x-slot name="title">Average Order</x-slot>
    <x-slot name="value">
      <span class="text-blue-400">{{ money($event->averageOrderTotal()) }}</span>
    </x-slot>
  </x-metric-block>

  <x-metric-block>
    <x-slot name="title">Total Revenue</x-slot>
    <x-slot name="value">
      <span class="text-green-400">{{ money($event->totalRevenue()) }}</span>
    </x-slot>
  </x-metric-block>
</div>

Key Points

  • Grid Layout adapts to screen size.
  • Slots define title and value.

📈 Registration Charts

Two primary chart types visualize registration trends:

Registrations by Day (Bar Chart)

File: metrics/registration-by-day-graph.blade.php

<canvas id="registrations-by-day" width="400" height="150"></canvas>
<script>
  var ctx = document.getElementById('registrations-by-day').getContext('2d');
  new Chart(ctx, {
    type: 'bar',
    data: {
      labels: {!! json_encode($registrationsByDay['dates']) !!},
      datasets: [{
        label: '# of Registrations by Day',
        data: {!! json_encode($registrationsByDay['count']) !!},
        backgroundColor: '{{ hex2rgba($event->website->color, 0.2) }}',
        borderColor: '{{ hex2rgba($event->website->color, 0.7) }}',
        borderWidth: 1
      }]
    },
    options: { scales: { y: { beginAtZero: true } } }
  });
</script>
  • Uses Chart.js for rendering.
  • Data passed as JSON from controller.

Registrations Over Time (Line Chart)

File: metrics/registration-graph.blade.php

<h5 class="mt-2 mb-0">Registrations</h5>
<canvas id="registrations" width="400" height="150"></canvas>
<script>
  var ctx = document.getElementById('registrations').getContext('2d');
  new Chart(ctx, {
    type: 'line',
    data: {
      labels: {!! json_encode($registrationsByDay['dates']) !!},
      datasets: [{
        label: '# of Registrations',
        data: {!! json_encode($registrationsByDay['total']) !!},
        backgroundColor: ['{{ hex2rgba($event->website->color, .2) }}'],
        borderColor: ['{{ hex2rgba($event->website->color, .7) }}'],
        borderWidth: 1
      }]
    },
    options: { scales: { y: { beginAtZero: true, stepSize: 10 } } }
  });
</script>
  • Highlights cumulative registration counts.

🛑 Attendee Drop Reasons

A table lists why attendees dropped, aiding root-cause analysis.

File: metrics/showcase-dropped-attendee-reasons-table.blade.php

@php $reasons = $event->droppedAttendeeReasons; @endphp
<x-block title="Attendee Drop Reasons" class="shadow-none">
  @if(count($reasons) > 0)
    <x-table bordered>
      <x-slot name="headers">
        <th>Title</th><th>Quantity</th>
      </x-slot>
      <x-slot name="rows">
        @foreach($reasons as $reason)
          <tr>
            <td>{{ ucwords($reason['deleted_reason']) }}</td>
            <td>{{ $reason['total'] }}</td>
          </tr>
        @endforeach
      </x-slot>
    </x-table>
  @else
    <p>No Dropped Attendees</p>
  @endif
</x-block>
  • Pulls data via $event->droppedAttendeeReasons.
  • Renders a bordered table component.

📊 Additional Tables & Graphs

File Purpose
metrics/tournament-orders.blade.php Gate, Team, Total Revenue blocks.
metrics/tier-count.blade.php #Teams per Program Tier table.
metrics/venue-costs-table.blade.php Venue rates and totals.
metrics/showcase-jerseys-table.blade.php Jersey sizes & quantities.
metrics/showcase-upsells-table.blade.php Upsell items breakdown.
metrics/division-count.blade.php Teams per Age Division table.
metrics/teams-graph.blade.php Teams added/dropped graphs.

⚙️ Dynamic Reports & Livewire

For week-by-week analytics, a Livewire component powers interactive pagination:

<!-- Within showcase-report view -->
<button wire:click="previous" class="btn btn-primary">Previous Week</button>
<button wire:click="next" class="btn btn-primary">Next Week</button>

<canvas id="{{ $data['website'] }}registrationChart-{{ $instanceId }}"></canvas>

<script>
  document.dispatchEvent(new CustomEvent("livewire:showcase-report-rendered", {
    detail: { instanceId: '{{ $instanceId }}', data: {!! json_encode($data) !!} }
  }));
</script>
  • wire:click controls date navigation.
  • Emits a custom event when chart data is ready.

📦 Dependencies & Components

  • Chart.js: Renders all charts.
  • <x-metric-block>: Shows single figures in a card.
  • <x-table>: Standardized table markup.
  • <x-block>: Section containers with titles/icons.
  • Alpine.js: Minimal interactivity (e.g., toggles, popovers).

🔍 Component Flow

flowchart TD
  A[admin-dashboard.blade.php] -->|AJAX load| B[reports/showcase-report.blade.php]
  B --> C[metrics/showcase-orders.blade.php]
  B --> D[metrics/registration-by-day-graph.blade.php]
  B --> E[metrics/showcase-dropped-attendee-reasons-table.blade.php]
  A -->|AJAX load| F[reports/tournament-report]
  F --> G[metrics/tournament-orders.blade.php]
  F --> H[metrics/division-count.blade.php]
  F --> I[metrics/venue-costs-table.blade.php]

This illustrates how the main dashboard dynamically injects report views, which in turn include relevant metric partials.


By centralizing charts and tables in Blade partials, the Prep Network platform ensures consistent, maintainable, and visually cohesive dashboards for critical event performance insights.