id(); $today = date('Y-m-d'); return view('livewire.patient.dashboard', [ 'currentAppointment' => Appointment::with(['serviceCategory', 'doctor']) ->where('patient_id', $userId) ->whereDate('appointment_date', $today) ->whereIn('status', ['waiting', 'calling']) ->first(), 'history' => Appointment::with(['serviceCategory']) ->where('patient_id', $userId) ->where('appointment_date', '<', $today) ->orderBy('appointment_date', 'desc') ->take(3) ->get(), 'news' => News::where('is_published', true) ->latest() // Sama dengan orderBy('created_at', 'desc') ->take(3) ->get(), ]); } }