user(); return [ 'upcomingConsultation' => $user->consultations() ->approved() ->where('booking_date', '>=', today()) ->orderBy('booking_date') ->orderBy('booking_time') ->first(), 'activeTimelinesCount' => $user->timelines()->active()->count(), 'latestTimeline' => $user->timelines()->active()->latest()->first(), 'recentUpdates' => TimelineUpdate::whereHas('timeline', fn ($q) => $q->where('user_id', $user->id)) ->latest() ->take(3) ->with('timeline') ->get(), 'pendingBookingsCount' => $user->consultations()->pending()->count(), 'canBookToday' => ! $user->consultations() ->whereDate('booking_date', today()) ->whereIn('status', ['pending', 'approved']) ->exists(), ]; } }; ?>