get(); $appointments = []; foreach($all_appointments as $appointment){ $appointments[] = [ 'id' => $appointment->id, 'title' => $appointment->scheduled_at->format('H:i') . ' - ' . $appointment->client->name, 'start' => $appointment->scheduled_at->format('Y-m-d\TH:i:s'), 'extendedProps' => [ 'client_name' => $appointment->client->name, 'client_phone' => $appointment->contact_phone, 'bike_model' => $appointment->bike_model, 'description' => $appointment->problem_description, 'parts_needed' => $appointment->parts_needed, 'estimated_cost'=> $appointment->estimated_cost, 'status' => $appointment->status, 'notes' => $appointment->notes, ], ]; } return view('agenda', compact('appointments')); } }