Beispiel #1
0
 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();
         }
     }
 }
Beispiel #3
0
 public static function getAppointmentStaff()
 {
     return ["success" => true, Appointment::all()];
 }