@extends('layouts.dashboard') @section('title', __('Admin Dashboard')) @section('page_title', __('Dashboard')) @section('content') {{-- Welcome band --}}
{{ __('Admin overview') }}

{{ __('Welcome back, :name', ['name' => explode(' ', auth()->user()->name)[0]]) }} ๐Ÿ‘‹

{{ __('Here is what is happening across :site today.', ['site' => setting('site_name', 'Learnify')]) }}

{{ money($stats['revenue_month']) }}
{{ __('This month') }}
{{ $stats['published'] }}
{{ __('Live courses') }}
{{ array_sum($todo) }}
{{ __('Action items') }}
{{-- KPIs --}}
@include('partials.dashboard.stat-card', ['label' => __('Total Users'), 'value' => number_format($stats['users']), 'icon' => 'bi-people', 'color' => 'primary', 'trend' => $stats['users_trend'], 'hint' => __('vs last month'), 'url' => route('admin.users.index')])
@include('partials.dashboard.stat-card', ['label' => __('Courses'), 'value' => number_format($stats['courses']), 'icon' => 'bi-collection-play', 'color' => 'info', 'hint' => $stats['published'] . ' ' . __('published'), 'url' => route('admin.courses.index')])
@include('partials.dashboard.stat-card', ['label' => __('Enrollments'), 'value' => number_format($stats['enrollments']), 'icon' => 'bi-journal-check', 'color' => 'warning', 'trend' => $stats['enrollments_trend'], 'hint' => __('vs last month')])
@include('partials.dashboard.stat-card', ['label' => __('Revenue'), 'value' => money($stats['revenue']), 'icon' => 'bi-cash-stack', 'color' => 'success', 'trend' => $stats['revenue_trend'], 'hint' => __('vs last month'), 'url' => route('admin.orders.index')])
{{-- Revenue chart --}}
{{ __('Revenue & Enrollments') }} {{ __('Last 12 months') }}
{{-- Action items --}}
{{ __('Needs your attention') }}
@php($items = [ ['label' => __('Courses awaiting approval'), 'count' => $todo['pending_courses'], 'url' => route('admin.courses.index', ['status' => 'pending']), 'icon' => 'bi-collection-play', 'cls' => 'lf-soft-warning'], ['label' => __('Payout requests'), 'count' => $todo['pending_payouts'], 'url' => route('admin.payouts.index'), 'icon' => 'bi-cash-stack', 'cls' => 'lf-soft-success'], ['label' => __('Refund requests'), 'count' => $todo['pending_refunds'], 'url' => route('admin.refunds.index'), 'icon' => 'bi-arrow-counterclockwise', 'cls' => 'lf-soft-danger'], ['label' => __('Unread messages'), 'count' => $todo['unread_messages'], 'url' => route('admin.messages.index'), 'icon' => 'bi-envelope', 'cls' => 'lf-soft-info'], ['label' => __('New leads'), 'count' => $todo['new_leads'], 'url' => route('admin.leads.index'), 'icon' => 'bi-person-rolodex', 'cls' => 'lf-soft-primary'], ]) @foreach($items as $it) {{ $it['label'] }} {{ $it['count'] }} @endforeach
{{-- Recent orders --}}
{{ __('Recent Orders') }} {{ __('View all') }}
@forelse($recentOrders as $order) @empty @endforelse
{{ __('Order') }}{{ __('Customer') }}{{ __('Total') }}{{ __('Status') }}{{ __('Date') }}
#{{ $order->order_no }}
@if($order->user)@endif {{ $order->user->name ?? 'โ€”' }}
{{ money($order->total) }} {{ status_label($order->payment_status) }} {{ $order->created_at->diffForHumans() }}
{{ __('No orders yet.') }}
{{-- Category share + top courses --}}
{{ __('Courses by Category') }}
@if($categoryShare->isNotEmpty())
@foreach($categoryShare as $name => $c)
{{ $name }}{{ $c }}
@endforeach
@else
{{ __('No published courses yet.') }}
@endif
{{ __('Top Courses') }}
{{ __('Awaiting Approval') }}{{ __('All') }}
@forelse($pendingCourses as $course)
{{ $course->title }}
{{ $course->instructor->name ?? 'โ€”' }} ยท {{ $course->created_at->diffForHumans() }}
{{ __('Review') }}
@empty
{{ __('Nothing pending.') }}
@endforelse
{{ __('New Users') }}{{ __('All') }}
@forelse($recentUsers as $u)
{{ $u->name }}
{{ $u->email }}
{{ status_label($u->getRoleNames()->first()) }}
@empty
{{ __('No users yet.') }}
@endforelse
{{ __('Recent Enrollments') }}
@forelse($recentEnrollments as $e)
{{ $e->student->name ?? 'โ€”' }} {{ __('enrolled in') }} {{ \Illuminate\Support\Str::limit($e->course->title ?? 'โ€”', 40) }}
{{ $e->created_at->diffForHumans() }}
@empty
{{ __('No activity yet.') }}
@endforelse
@endsection @push('scripts') @endpush