@extends('layouts.app') @section('title', $campaign->name . ' · Channels') @section('page-title', $campaign->name) @section('page-subtitle', 'YouTube channels linked to this campaign') @section('topbar-actions') Videos Edit Campaign @endsection @push('styles') @endpush @section('content') @if(session('success'))
{{ session('success') }}
@endif {{-- ── Filter bar ── --}}
All time Last 7 days {{-- Last 30 days --}}
{{-- ── Notice banners ── --}} @if($windowed) @if($anyFallback && !$anyDelta)
Showing current values — not enough daily snapshots yet to calculate growth for {{ $from?->format('M j') }} → {{ $to?->format('M j, Y') }}. Growth figures will appear once syncs have run on at least 2 different days within this range.
@elseif($anyFallback && $anyDelta)
Showing growth for {{ $from?->format('M j, Y') }} → {{ $to?->format('M j, Y') }}. Channels marked current don't have enough snapshots in this window yet.
@else
Showing growth between {{ $from?->format('M j, Y') }} and {{ $to?->format('M j, Y') }}. Values show change over this period — green is growth, red is decline.
@endif @endif
Channels {{ $channels->count() }}
{{-- ── Add channel form ── --}}
@csrf
Accepts: https://youtube.com/@handle  ·  @handle  ·  Channel ID (UCxxxxxx)
@error('channel_input')
{{ $message }}
@enderror {{-- Account selector: which Google account owns this channel? --}}
@if($channels->isEmpty())

No channels added yet

Paste a YouTube channel URL or @handle above to start tracking subscriber, video and view counts.

@else
@if($windowed && $anyDelta && !$anyFallback) Subscribers Videos Uploaded Views @else Subscribers Videos Uploaded Views @endif
@foreach($channels as $channel) @php $isDelta = ($channel->disp_mode ?? 'actual') === 'delta'; $deltaClass = function($raw) use ($isDelta) { if (!$isDelta || $raw === null) return ''; if ($raw > 0) return 'delta-positive'; if ($raw < 0) return 'delta-negative'; return 'delta-zero'; }; $subsClass = $deltaClass($channel->disp_subs_raw ?? null); $videosClass = $deltaClass($channel->disp_videos_raw ?? null); $viewsClass = $deltaClass($channel->disp_views_raw ?? null); @endphp
@if($channel->thumbnail) {{ $channel->channel_name }} @else
@endif
@if($channel->last_synced_at)
Synced {{ $channel->last_synced_at->diffForHumans() }}
@endif @if($anyDelta && !$isDelta) current @endif
{{ $channel->disp_subs }}
{{ $channel->disp_videos }}
{{ $channel->disp_views }}
@csrf
@csrf @method('DELETE')
@endforeach
@endif
{{-- ── Right sidebar ── --}}
@if($windowed && $anyDelta && !$anyFallback) Growth Summary @else Campaign Summary @endif
Channels Tracked {{ $channels->count() }}
{{ ($windowed && $anyDelta && !$anyFallback) ? 'Subscriber Growth' : 'Total Subscribers' }} @php $allDeltaMode = $windowed && $anyDelta && !$anyFallback; $sumSubsRaw = $allDeltaMode ? (int) filter_var($summarySubs, FILTER_SANITIZE_NUMBER_INT) : 0; $subsValueClass = $allDeltaMode ? ($sumSubsRaw > 0 ? 'growth-positive' : ($sumSubsRaw < 0 ? 'growth-negative' : 'growth-zero')) : ''; @endphp {{ $summarySubs }} @if($hiddenCount) +{{ $hiddenCount }} hidden @endif
{{ ($windowed && $anyDelta && !$anyFallback) ? 'Videos Added' : 'Total Videos Uploaded' }} {{ $summaryVideos }}
{{ ($windowed && $anyDelta && !$anyFallback) ? 'View Growth' : 'Total Views' }} {{ $summaryViews }}
💡 Tips
Add any channel
Paste a URL like youtube.com/@handle or just the handle @handle.
Select the right account
Choose the Google account that owns the channel for accurate subscriber analytics.
Auto-sync daily
Stats refresh automatically every 24 hours. Use the sync button for immediate updates.
@endsection