public function doDeleteCoT($id) { $treatment_plan = TreatmentPlan::findOrFail($id); $treatment_plan->remove(); return redirect()->back(); }
public function doAddCoTAppointment(Request $request) { $treatment_plan = TreatmentPlan::findOrFail($request->cot_id); $appointment = Appointment::addNew(2, 'CoT #' . $treatment_plan->id, $treatment_plan->patient_id, $treatment_plan->patient->dentist_id, '', '', '', '', '', '', $treatment_plan->id, '0', $treatment_plan->appointments->count() + 1); $vars = ["appointment" => $appointment, "last_appointment" => true, "first_appointment" => false]; $response = ["appointment" => $appointment, "html" => view('backend.partials.cot-appointment-row')->with($vars)->render()]; header('Content-Type: application/json'); return json_encode($response); }