{{-- resources/views/superadmin/notifyhub/dashboard.blade.php --}} @extends('layouts.superadmin') @section('title','NotifyHub — غرفة الإشعارات') @section('content') @php $from = $from ?? now()->subDays(14)->toDateString(); $to = $to ?? now()->toDateString(); $kpis = $kpis ?? (object)[ 'total'=>0,'sent'=>0,'scheduled'=>0,'draft'=>0,'failed'=>0 ]; $typePie = $typePie ?? collect(); $statusPie = $statusPie ?? collect(); $daily = $daily ?? collect(); $latest = $latest ?? collect(); $ai = $ai ?? [ 'total'=>0,'sent'=>0,'scheduled'=>0,'failed'=>0,'fail_rate'=>0, 'tips'=>[ ['title'=>'جاهزين!', 'body'=>'ابدأ بإنشاء إشعار جديد أو فعل القواعد التلقائية.'] ] ]; $route = fn($name) => \Illuminate\Support\Facades\Route::has($name) ? route($name) : '#'; // JSON للرسوم $typeLabels = $typePie->pluck('type')->values(); $typeValues = $typePie->pluck('c')->values(); $statusLabels = $statusPie->pluck('status')->values(); $statusValues = $statusPie->pluck('c')->values(); $daysLabels = $daily->pluck('day')->values(); $daysTotal = $daily->pluck('total_sent')->map(fn($x)=> (int)$x)->values(); $daysFailed = $daily->pluck('failed')->map(fn($x)=> (int)$x)->values(); $badge = [ 'sent' => 'border-emerald-400/25 bg-emerald-500/15 text-emerald-200', 'scheduled' => 'border-sky-400/25 bg-sky-500/15 text-sky-200', 'draft' => 'border-slate-400/25 bg-white/10 text-white/80', 'cancelled' => 'border-rose-400/25 bg-rose-500/15 text-rose-200', 'failed' => 'border-rose-400/25 bg-rose-500/15 text-rose-200', ]; @endphp
هنا بتتحكم بكل الإشعارات: يدوي + تلقائي (Rules) + جدولة + سجل قنوات الإرسال — ومع تحليلات AI + עוגות ותרשימים.
| # | العنوان | Type | Audience | Status | Created |
|---|---|---|---|---|---|
| {{ (int)($n->id ?? 0) }} |
{{ (string)($n->title ?? '—') }}
{{ \Illuminate\Support\Str::limit((string)($n->body ?? ''), 120) }}
|
{{ $typ }} | {{ (string)($n->audience ?? 'all') }} | {{ $st }} | {{ !empty($n->created_at) ? \Illuminate\Support\Carbon::parse($n->created_at)->format('Y-m-d H:i') : '—' }} |
| لا يوجد إشعارات بعد — ابدأ بإنشاء أول إشعار 👑 | |||||