@extends('layouts.app') @section('title', 'Influencers') @section('page-title', 'Influencers') @push('head') @endpush @push('styles') @endpush @section('content') @if(session('success'))
{{ session('success') }}
@endif {{-- ── Summary bar ── --}} @php $totalActive = $influencers->count(); $totalApproved = $approvedInfluencers->count(); $totalSubs = $influencers->sum(fn($i) => max(0,(int)($i->subscriber_count??0))) + $approvedInfluencers->sum(fn($u) => max(0,(int)($u->yt_subscriber_count??0))); $totalViews = $influencers->sum(fn($i) => (int)($i->yt_view_count??0)) + $approvedInfluencers->sum(fn($u) => (int)($u->yt_view_count??0)); @endphp
{{ $totalActive + $totalApproved }}
Total Influencers
{{ $totalActive }}
Active
{{ $totalApproved }}
Approved
{{ \App\Services\YouTubeService::fmt($totalSubs) }}
Total Subscribers
{{ \App\Services\YouTubeService::fmt($totalViews) }}
Total Views
{{-- ═══ PANE 1: Active ═══ --}}
@if($influencers->whereNotNull('youtube_url')->count() > 0) @endif
@if($influencers->isEmpty())
No active influencers yet
Use the Import button above to add influencers from a spreadsheet.
@else @foreach($influencers as $inf) @php $synced = !is_null($inf->yt_synced_at); $subCount = (int)($inf->subscriber_count ?? 0); $viewCount = (int)($inf->yt_view_count ?? 0); $vidCount = (int)($inf->yt_video_count ?? 0); @endphp @endforeach
InfluencerPlatformsSubscribers VideosViewsIndustry
{{ strtoupper(substr($inf->influencer_name,0,1)) }}
{{ $inf->influencer_name }}
@if($inf->channel_name)
{{ $inf->channel_name }}
@endif
@if($inf->youtube_url)YouTube@endif @if($inf->instagram_url)Instagram@endif @if(!$inf->youtube_url && !$inf->instagram_url)@endif
@if($inf->youtube_url && $synced)
{{ $subCount===-1?'Hidden':\App\Services\YouTubeService::fmt($subCount) }}
Subs
@else@endif
@if($inf->youtube_url && $synced)
{{ number_format($vidCount) }}
Videos
@else@endif
@if($inf->youtube_url && $synced)
{{ \App\Services\YouTubeService::fmt($viewCount) }}
Views
{{ $inf->yt_synced_at->diffForHumans() }}
@elseif($inf->youtube_url)Not synced @else@endif
@if($inf->industry){{ $inf->industry_label }} @else@endif
@if($inf->youtube_url) @endif
@csrf @method('DELETE')
@endif
{{-- ═══ PANE 2: Approved ═══ --}}
@php $ytApprovedCount = $approvedInfluencers->filter(fn($u)=>$u->channel_url&&(str_contains($u->channel_url,'youtube.com')||str_contains($u->channel_url,'youtu.be')))->count(); @endphp
@if($ytApprovedCount > 0) @endif
@if($approvedInfluencers->isEmpty())
No approved influencers yet
Influencers who sign up and get approved will appear here.@if($pendingCount>0)
{{ $pendingCount }} pending — review in User Management.@endif
@else @foreach($approvedInfluencers as $user) @php $isYt = $user->channel_url&&(str_contains($user->channel_url,'youtube.com')||str_contains($user->channel_url,'youtu.be')); $synced = $isYt&&!is_null($user->yt_synced_at); $subCount = (int)($user->yt_subscriber_count??0); $viewCount = (int)($user->yt_view_count??0); $vidCount = (int)($user->yt_video_count??0); @endphp @endforeach
InfluencerChannelSubscribers VideosViewsIndustryStatus
{{ strtoupper(substr($user->name,0,1)) }}
{{ $user->name }}
{{ $user->email }}
@if($user->channel_name)
{{ $user->channel_name }}
@endif @if($user->channel_url)Visit Channel@endif @if(!$user->channel_name&&!$user->channel_url)@endif
@if($isYt&&$synced)
{{ $subCount===-1?'Hidden':\App\Services\YouTubeService::fmt($subCount) }}
Subs
@else@endif
@if($isYt&&$synced)
{{ number_format($vidCount) }}
Videos
@else@endif
@if($isYt&&$synced)
{{ \App\Services\YouTubeService::fmt($viewCount) }}
Views
{{ $user->yt_synced_at->diffForHumans() }}
@elseif($isYt)Not synced @else@endif
@if($user->industry){{ $industries[$user->industry]??ucfirst($user->industry) }} @else@endif Approved
@if($isYt) @endif
@csrf
@csrf @method('DELETE')
@endif
{{-- ═══ Import Modal — IDENTICAL structure to original ═══ --}}
Processing…
Import Active Influencers
Upload a CSV file and map your columns
1
Upload File
2
Map Columns
3
Preview & Import
4
Done
Drop your file here
or click to browse from your computer
CSV
Match each column from your file to the correct database field.
Your ColumnMaps to Field
* Name is required.
Total Rows
Mapped Columns
Preview Rows
@endsection @push('scripts') @endpush