@include('livewire.admin.partials.tab')
@if(($role_id == 1) || in_array(87, $permissions)) @endif
@php // Yesterday $yesterday = strtotime('-1 day'); $formattedDateYesterday = date('jS M', $yesterday); // Last Week (same day last week) $yesterday_to = strtotime('-1 day'); $yesterday_last = strtotime('-2 day'); $yesterday_to = date('jS M', $yesterday_to); $yesterday_last = date('jS M', $yesterday_last); $lastWeek = strtotime('-8 day'); $formattedDateLastWeek = date('jS M', $lastWeek); $lastMonth = strtotime('-32 day'); $formattedDateLastMonth = date('jS M', $lastMonth); @endphp {{-- Yesterday --}} {{-- Last Week --}} {{-- Last Month --}} @php $totals = [ 'yesterday_news' => 0, 'yesterday_users' => 0, 'yesterday_views' => 0, 'new_traffic_yesterday_news' => 0, 'last_7_days_news' => 0, 'last_7_days_users' => 0, 'last_7_days_views' => 0, 'new_traffic_last_week_news' => 0, 'last_1_month_news' => 0, 'last_1_month_users' => 0, 'last_1_month_views' => 0, 'new_traffic_last_month_news' => 0, ]; @endphp @foreach ($cryptoNews as $row) {{-- 🔹 First Table: Matched URLs --}} {{-- 🔹 Second Table: All URLs --}} @endforeach
Yesterday ({{$formattedDateYesterday}}) Last Week ({{$formattedDateLastWeek}} to {{$yesterday_last}}) Last Month ({{$formattedDateLastMonth}} to {{$yesterday_last}})
Author Name Category Total Post URL ({{ $totalAllViews['yesterday_all_urls_post'] }}) Total Tr URL ({{ $totalAllViews['yesterday_all_urls_total'] }}) Total Users ({{ $totalAllViews['yesterday_all_users_total'] }}) Total Views ({{ $totalAllViews['yesterday_all_views_total'] }}) Tr/URL ({{ $totalAllViews['yesterday_all_urls_total'] > 0 ? round($totalAllViews['yesterday_all_users_total'] / $totalAllViews['yesterday_all_urls_total'], 2) : 0 }}) Total Post URL ({{ $totalAllViews['last_week_all_urls_post'] }}) Total Tr URL ({{ $totalAllViews['last_week_all_urls_total'] }}) Total Users ({{ $totalAllViews['last_week_all_users_total'] }}) Total Views ({{ $totalAllViews['last_week_all_views_total'] }}) Tr/URL ({{ $totalAllViews['last_week_all_urls_total'] > 0 ? round($totalAllViews['last_week_all_users_total'] / $totalAllViews['last_week_all_urls_total'], 2) : 0 }}) Total Post URL ({{ $totalAllViews['last_month_all_urls_post'] }}) Total Tr URL ({{ $totalAllViews['last_month_all_urls_total'] }}) Total Users({{ $totalAllViews['last_month_all_users_total'] }}) Total Views({{ $totalAllViews['last_month_all_views_total'] }}) Tr/URL ({{ $totalAllViews['last_month_all_urls_total'] > 0 ? round($totalAllViews['last_month_all_users_total'] / $totalAllViews['last_month_all_urls_total'], 2) : 0 }}) Action
{{ $row['author_name'] }} Post{{ $row['yesterday_posts'] }} {{ $row['yesterday_urls'] }} {{ $row['yesterday_users'] }} {{ $row['yesterday_views'] }} {{ $row['yesterday_urls'] > 0 ? round($row['yesterday_users'] / $row['yesterday_urls'], 2) : 0 }} {{ $row['last_week_posts'] }} {{ $row['last_week_urls'] }} {{ $row['last_week_users'] }} {{ $row['last_week_views'] }} {{ $row['last_week_urls'] > 0 ? round($row['last_week_users'] / $row['last_week_urls'], 2) : 0 }} {{ $row['last_month_posts'] }} {{ $row['last_month_urls'] }} {{ $row['last_month_users'] }} {{ $row['last_month_views'] }} {{ $row['last_month_urls'] > 0 ? round($row['last_month_users'] / $row['last_month_urls'], 2) : 0 }}
Traffic - {{ $row['yesterday_all_urls'] }} {{ $row['yesterday_all_users'] }} {{ $row['yesterday_all_views'] }} {{ $row['yesterday_all_urls'] > 0 ? round($row['yesterday_all_users'] / $row['yesterday_all_urls'], 2) : 0 }} - {{ $row['last_week_all_urls'] }} {{ $row['last_week_all_users'] }} {{ $row['last_week_all_views'] }} {{ $row['last_week_all_urls'] > 0 ? round($row['last_week_all_users'] / $row['last_week_all_urls'], 2) : 0 }} - {{ $row['last_month_all_urls'] }} {{ $row['last_month_all_users'] }} {{ $row['last_month_all_views'] }} {{ $row['last_month_all_urls'] > 0 ? round($row['last_month_all_users'] / $row['last_month_all_urls'], 2) : 0 }}