@extends('layouts.app') @section('title', 'Admin Dashboard - Gletra') @section('content')
@include('admin.partials.sidebar')
@php $role = auth()->user()->getActiveAdminRole(); @endphp
{{-- Hero --}}
{{ \App\Models\User::ADMIN_ROLE_LABELS[$role] ?? ucfirst($role) }} @if(auth()->user()->canSwitchAdminRole()) ({{ count(auth()->user()->getAdminRoles()) }} roles) @endif

Dashboard

Welcome, {{ auth()->user()->name }} • {{ now()->format('l, d M Y') }}

@if($role === 'admin' && $actionTotal > 0) {{ $actionTotal }} pending @endif
@if($role === 'admin') @endif @if($role === 'admin') @include('admin.partials.dashboard-analytics', ['analyticsCompact' => true]) @else {{-- Overview stats (non-admin roles) --}}
Overview
@if(in_array($role, ['admin', 'support'])) @endif
@endif {{-- Needs attention --}}
Needs Attention
Live
@if($role === 'admin')
{{ $stats['pending_vendors'] }}
Vendors
@endif @if(in_array($role, ['admin', 'editor']))
{{ $stats['pending_products'] }}
Products
@endif @if($role === 'admin')
{{ $stats['pending_payouts'] }}
Payouts
@endif @if(in_array($role, ['admin', 'support']))
{{ $stats['pending_refunds'] }}
Refunds
@endif
{{ $stats['open_tickets'] }}
Tickets
@if($role === 'editor')
Sales (Last 7 Days)
Report
@endif {{-- Recent messages --}}
Recent Messages
View all
@forelse($recentMessages as $msg) @if($msg->sender)
{{ $msg->sender->name }}
{{ $msg->sender->name }} {{ $msg->created_at->diffForHumans() }}

{{ $msg->message }}

@if($msg->conversation) View @endif
@endif @empty
No recent messages
@endforelse
{{-- Right sidebar --}}
@if($role === 'admin')
Source Protection
@php $protection = \App\Models\Setting::get('source_protection', 'enabled'); @endphp {{ $protection === 'enabled' ? 'Enabled' : 'Disabled' }}

Blocks right-click & DevTools on store.

@csrf
@if($stats['low_stock_products'] > 0)
Low Stock

{{ $stats['low_stock_products'] }} products below 10 units

Review Products
@endif @endif
@push('styles') @endpush @if($role === 'editor') @push('scripts') @endpush @endif @endsection