addMinutes(15)->format('H:i:s'))->where('appointment_time', '>=', Carbon::now()->format('H:i:s'))->get(); foreach ($appointments as $appointment) { // Concatenate date and time $datetimeUtc = $appointment->appointment_date . ' ' . $appointment->appointment_time; // Convert to UTC timezone $dateTimeUtc = Carbon::createFromFormat('Y-m-d H:i:s', $datetimeUtc, 'UTC'); // Convert to the appointment's timezone $appointmentTimeZone = new CarbonTimeZone($appointment->timezone); $dateTimeInAppointmentTimeZone = $dateTimeUtc->setTimezone($appointmentTimeZone); // Split the datetime into date and time components in the appointment timezone $appointment->appointment_date = $appointmentDate = $dateTimeInAppointmentTimeZone->format('Y-m-d'); $appointment->appointment_time = $appointmentTime = $dateTimeInAppointmentTimeZone->format('H:i:s'); $patient = $appointment->patient; Mail::send('emails.upcoming-meeting', ['patient' => $patient, 'appointment' => $appointment], function ($message) use ($patient) { $message->to("muhammadawais95@gmail.com", $patient->first_name) ->subject('Upcoming Meeting Reminder'); }); } } }