public function getAppointments() { $appointments = Appointment::all(); $response = ["appointments" => $appointments->toArray()]; header('Content-type: application/json'); die(json_encode($response)); }
public function updateAppointments() { $appointments = Appointment::all(); foreach ($appointments as $appointment) { $lead = Lead::where('id', $appointment->lead_id)->first(); if ($lead) { $appointment->agent_id = $lead->agent_crest_id; $appointment->save(); } } }
public static function getAppointmentStaff() { return ["success" => true, Appointment::all()]; }