[ 'total_patients' => Patient::count(), 'today_appointments' => Appointment::whereDate('appointment_date', $today)->count(), 'total_doctors' => Doctor::count(), 'published_news' => News::where('is_published', true)->count(), ], 'recentAppointments' => Appointment::with(['patient', 'serviceCategory']) ->whereDate('appointment_date', $today) ->whereIn('status', ['waiting', 'calling']) ->orderBy('queue_number', 'asc') ->take(5) ->get(), 'popularNews' => News::orderBy('view_count', 'desc')->take(5)->get(), ]); } }