API APP DOCTOR
This commit is contained in:
@@ -391,9 +391,7 @@ class Helper
|
||||
$mail->send();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
dd($e);
|
||||
return ($mail->ErrorInfo);
|
||||
return false;
|
||||
return $mail->ErrorInfo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,16 +461,16 @@ class Helper
|
||||
$lonFrom = deg2rad($longitudeFrom);
|
||||
$latTo = deg2rad($latitudeTo);
|
||||
$lonTo = deg2rad($longitudeTo);
|
||||
|
||||
|
||||
// Calculate the change in coordinates
|
||||
$deltaLat = $latTo - $latFrom;
|
||||
$deltaLon = $lonTo - $lonFrom;
|
||||
|
||||
|
||||
// Apply Haversine formula
|
||||
$a = sin($deltaLat / 2) * sin($deltaLat / 2) + cos($latFrom) * cos($latTo) * sin($deltaLon / 2) * sin($deltaLon / 2);
|
||||
$c = 2 * atan2(sqrt($a), sqrt(1 - $a));
|
||||
$distance = $earthRadius * $c;
|
||||
|
||||
|
||||
return $distance;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user