@extends('layouts.app') @section('title', $campaign->name . ' — Posts') @section('page-title', $campaign->name) @section('page-subtitle', 'YouTube video tracking') @section('topbar-actions')
@csrf
← All Campaigns @endsection @push('styles') @endpush @section('content') {{-- ── Add URL Card ── --}}
Add YouTube Video
Paste any YouTube URL — views, likes and subscribers are fetched instantly from the YouTube API.
@csrf
YouTube URL
@error('post_url')
{{ $message }}
@enderror
@if(auth()->user()->role !== 'influencer')
Influencer (optional)
@endif
{{-- ── Stats Bar ── --}}
{{ number_format($totals['views']) }}
Total Views
{{ number_format($totals['likes']) }}
Total Likes
{{-- ── NEW: Total Subscribers stat card ── --}}
{{ number_format($totals['subscribers'] ?? 0) }}
Total Subscribers
{{ number_format($totals['posts']) }}
Videos
{{ $totals['views'] > 0 ? number_format(($totals['likes'] / $totals['views']) * 100, 2) : '0.00' }}%
Engagement Rate
{{-- ── Posts Table ── --}}

Tracked Videos {{ $posts->count() }}

{{-- ── NEW: Subscribers column header ── --}} @forelse($posts as $post) {{-- ── NEW: Subscribers column cell ── --}} @empty @endforelse
Video Views Likes Subscribers Last Synced Actions
@if($post->thumbnail) @else
@endif
{{ $post->title ?? 'Untitled Video' }}
Open on YouTube
{{ number_format($post->views) }}
views
{{ number_format($post->likes) }}
likes
{{ number_format($post->subscribers ?? 0) }}
subscribers
{{ $post->last_synced_at ? $post->last_synced_at->diffForHumans() : 'Never' }}
@csrf
@csrf @method('DELETE')
No videos added yet Paste a YouTube URL above to start tracking views and likes.
@endsection