@extends('layouts.admin') @section('title', 'Dashboard') @push('vendor-styles') @endpush @push('page-styles') @endpush @section('header-actions') @can('news.create') New article @endcan @endsection @section('content') @php $t = $stats['totals']; $statusLink = fn (\App\Enums\ArticleStatus $s) => route('admin.news.index', ['status' => $s->value]); $cards = [ ['Total Articles', $t['articles'], 'file-text', 'primary', route('admin.news.index')], ['Published', $t['published'], 'check-circle', 'success', $statusLink(\App\Enums\ArticleStatus::Published)], ['Drafts', $t['draft'], 'edit-3', 'secondary', $statusLink(\App\Enums\ArticleStatus::Draft)], ['Pending Review', $t['pending'], 'clock', 'warning', $statusLink(\App\Enums\ArticleStatus::Pending)], ['Scheduled', $t['scheduled'], 'calendar', 'info', $statusLink(\App\Enums\ArticleStatus::Scheduled)], ['Breaking (live)', $t['breaking'], 'zap', 'danger', route('admin.news.index', ['breaking' => 1, 'status' => \App\Enums\ArticleStatus::Published->value])], ['Featured (live)', $t['featured'], 'star', 'warning', route('admin.news.index', ['featured' => 1, 'status' => \App\Enums\ArticleStatus::Published->value])], ['Countries', $t['countries'], 'globe', 'primary', auth()->user()->can('countries.manage') ? route('admin.countries.index') : null], ['Categories', $t['categories'], 'layers', 'info', auth()->user()->can('categories.manage') ? route('admin.categories.index') : null], ['Authors', $t['authors'], 'feather', 'success', auth()->user()->can('authors.manage') ? route('admin.authors.index') : null], ]; @endphp
@foreach ($cards as [$label, $value, $icon, $color, $link])

{{ number_format($value) }}

@if ($link) {{ $label }} @else

{{ $label }}

@endif
@endforeach

Statistics cached · generated {{ \Illuminate\Support\Carbon::parse($stats['generated_at'])->diffForHumans() }}

Articles published per day (last 30 days)

Articles by status

Top categories (published, 30 days)

Top countries (published, 30 days)

Recent articles

View all
@forelse ($recent as $article) @empty @endforelse
TitleCountryCategoryStatusCreated
{{ $article->title }} @if ($article->is_breaking)Breaking@endif {{ $article->country?->name }} {{ $article->category?->name }} {{ $article->status->label() }} {{ $article->created_at?->diffForHumans() }}
No articles yet.
@php $chartData = [ 'perDay' => $stats['per_day'], 'byCategory' => $stats['by_category'], 'byCountry' => $stats['by_country'], 'byStatus' => [ 'Published' => $t['published'], 'Draft' => $t['draft'], 'Pending' => $t['pending'], 'Scheduled' => $t['scheduled'], 'Archived' => $t['archived'], ], ]; @endphp @endsection @push('vendor-scripts') @endpush @push('page-scripts') @endpush