{{-- ══ Livewire loading overlay ══ --}}
Loading data…
{{-- ══ FILTER CARD ══ --}}
{{-- Exports are plain GET — cannot go through Livewire --}}
{{-- ══ SUMMARY STAT CARDS ══ --}} @if(!empty($summaryStats)) @php $total = ($summaryStats['focus_ranked'] ?? 0) + ($summaryStats['focus_not_ranked'] ?? 0); $rankedPct = $total > 0 ? round(($summaryStats['focus_ranked'] / $total) * 100, 1) : 0; @endphp
{{ number_format($summaryStats['total_urls']) }}
Total URLs
in date range
{{ number_format($summaryStats['focus_ranked']) }}
Focus Ranked
impressions > 0
{{ number_format($summaryStats['focus_not_ranked']) }}
Not Ranked
no GSC data
{{ number_format($summaryStats['other_kw_total']) }}
Total GSC Rows
all queries
{{ $rankedPct }}%
Ranked Rate
focus keywords
@endif {{-- ══ TABLE ══ --}}
@forelse($crypto_news as $i => $news) {{-- ✅ $news is a PLAIN ARRAY — use $news['key'] not $news->key Available keys: id, alias, title, page_url, published_label, author_name, gsc_total_records gsc_focus_keyword → array: query, clicks, impressions, position, ctr, is_ranking, ranked_days, has_data gsc_ranking_keywords → array of arrays: query, clicks, impression, avg_position, ctr, ranked_days, keyword_type, position_badge --}} @php $focus = $news['gsc_focus_keyword']; $ranking = collect($news['gsc_ranking_keywords']); // Colour-code focus position $fPos = is_numeric($focus['position']) ? (float) $focus['position'] : 99; $fPosColor = $fPos <= 3 ? '#0d7a45' : ($fPos <=10 ? '#1a3a8f' : ($fPos <=20 ? '#b45309' : '#c0392b' )); @endphp {{-- # --}} {{-- DATE — pre-resolved in component as published_label --}} {{-- AUTHOR --}} {{-- ARTICLE --}} {{-- TOTAL KEYWORDS --}} {{-- FOCUS KEYWORD --}} {{-- RANKING KEYWORDS --}} @empty @endforelse
# Date Author Article Keywords Focus Keyword Ranking Keywords
{{ $crypto_news->firstItem() + $i }} {{ $news['published_label'] ?? '—' }} {{ $news['author_name'] ?? 'Team' }}
{{ Str::limit($news['title'], 65) }}
{{ Str::limit($news['page_url'], 55) }}
@if(($news['gsc_total_records'] ?? 0) > 0) {{ number_format($news['gsc_total_records']) }} @else
No Data
@endif
@if($focus['has_data'] && $focus['impressions'] > 0) {{ $focus['query'] }}
{{ number_format($focus['clicks']) }} Clicks
{{ number_format($focus['impressions']) }} Impr.
{{ $focus['ctr'] }}% CTR
{{ $focus['position'] }} Pos.
{{ $focus['ranked_days'] ?? 0 }}d Days
@else
{{ Str::limit($focus['query'] ?? '—', 32) }}
Not ranking in GSC
@endif
@if($ranking->isNotEmpty()) @php $totalClicks = $ranking->sum('clicks'); $totalImpr = $ranking->sum('impression'); $kwCount = $ranking->count(); $avgCtr = $kwCount > 0 ? number_format($ranking->avg('ctr'), 2) : '0.00'; @endphp
{{ $kwCount }} KW
{{ number_format($totalClicks) }} Clicks
{{ number_format($totalImpr) }} Impr.
{{ $avgCtr }}% Avg CTR
@foreach($ranking as $kw) @php $badge = $kw['position_badge'] ?? ['label'=>'—','color'=>'#888','bg'=>'#f5f5f5']; @endphp
{{ $kw['query'] }}
{{ number_format($kw['clicks']) }} {{ number_format($kw['impression']) }} impr. {{ $kw['ctr'] }}% CTR {{ $badge['label'] }} @if(!empty($kw['ranked_days'])) {{ $kw['ranked_days'] }}d ranked @endif @if(!empty($kw['keyword_type'])) {{ $kw['keyword_type'] }} @endif
@endforeach
@else
No Ranking Keywords
Not ranked in GSC
@endif

No data found for the selected filters.

{{-- ══ PAGINATION ══ --}}
{{ $crypto_news->appends(request()->query())->links() }}
{{-- ══ QUERY DETAIL MODAL ══ --}}