@extends('layouts.admin') @section('title', 'Dashboard') @section('header_title', 'Dashboard') @section('header_subtitle', 'Welcome back, ' . auth()->user()->name) @push('styles') @endpush @section('content')
{{-- Welcome banner --}}

Good {{ now()->hour < 12 ? 'morning' : (now()->hour < 18 ? 'afternoon' : 'evening') }}, {{ explode(' ', auth()->user()->name)[0] }}!

Here's what's happening with your newsroom today.

{{-- Quick actions --}}
Quick actions
Pull new stories, write something, or push a breaking alert.
Import news New article Breaking alert
@csrf
@csrf
@csrf
{{-- KPI Grid --}}
@php $kpis = [ ['label' => 'Total Articles', 'value' => $stats['total_articles'], 'icon' => 'document', 'cls' => 'kpi-blue', 'sub' => $stats['published_today'].' published today'], ['label' => 'Total Views', 'value' => number_format($stats['total_views']), 'icon' => 'eye', 'cls' => 'kpi-cyan', 'sub' => number_format($stats['views_today']).' today', 'trend' => $trends['views_pct']], ['label' => 'Subscribers', 'value' => number_format($stats['newsletter_subscribers']), 'icon' => 'mail', 'cls' => 'kpi-purple', 'sub' => 'newsletter list', 'trend' => $trends['subscribers_pct']], ['label' => 'Pending Comments', 'value' => $stats['pending_comments'], 'icon' => 'chat', 'cls' => 'kpi-amber', 'sub' => $stats['total_comments'].' total'], ['label' => 'Drafts', 'value' => $stats['drafts'], 'icon' => 'pencil', 'cls' => 'kpi-slate', 'sub' => $stats['scheduled'].' scheduled'], ['label' => 'Breaking News', 'value' => $stats['breaking_stories'], 'icon' => 'bolt', 'cls' => 'kpi-rose', 'sub' => $stats['featured_stories'].' featured'], ['label' => 'Active Users', 'value' => $stats['total_users'], 'icon' => 'users', 'cls' => 'kpi-green', 'sub' => 'editors & readers'], ['label' => 'News Tips', 'value' => $stats['pending_tips'], 'icon' => 'tip', 'cls' => 'kpi-orange', 'sub' => 'awaiting review'], ]; @endphp @foreach($kpis as $kpi)
{{ $kpi['label'] }}
@if(isset($kpi['trend'])) @php $trend = $kpi['trend']; @endphp @if($trend > 0) ↑ @elseif($trend < 0) ↓ @else — @endif {{ abs($trend) }}% @endif
{{ $kpi['value'] }}
{{ $kpi['sub'] }}
@endforeach
{{-- Charts row --}}

Traffic & Publishing

Last 7 days

Views Articles

Article Status

Current breakdown

@php $statusMap = [ 'published' => ['Published', 'bg-emerald-500'], 'draft' => ['Draft', 'bg-slate-500'], 'scheduled' => ['Scheduled', 'bg-amber-500'], 'archived' => ['Archived', 'bg-rose-500'], ]; @endphp @foreach($statusMap as $key => [$label, $cls])
{{ $label }}
{{ $statusBreakdown[$key] ?? 0 }}
@endforeach
{{-- Hourly + Content performance --}}

Today's Traffic

Hourly page views

Top Performing Stories

By total page views

View all →
{{-- Recent + Categories + Locations + Activity --}}

Top Categories

Manage →
@forelse($topCategories as $cat)
{{ $cat->name }} {{ $cat->articles_count }}
@empty
No categories yet.
@endforelse

Top Locations

Manage →
@forelse($topLocations as $loc)
{{ $loc->name }}
{{ $loc->articles_count }}
@empty
No locations yet.
@endforelse
{{-- Bottom row: Comments + Tips --}}

Recent Comments

Moderate →
@forelse($recentComments as $c)
{{ $c->user?->name ?? 'Anonymous' }} {{ ucfirst($c->status) }}

{{ Str::limit(strip_tags($c->body), 120) }}

on “{{ $c->article?->title ?? '—' }}” · {{ $c->created_at?->diffForHumans() ?? '—' }}
@empty
No comments yet.
@endforelse
{{-- Quick actions --}}

Quick Actions

@endsection @push('scripts') @endpush