Skip to content

fix/distance parameter type for v2.x #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025

Conversation

tkaratug
Copy link
Collaborator

This pull request addresses a type mismatch issue in the scopeWithinDistanceTo method and related methods in the laravel-spatial package. The $distance parameter type has been updated from int to float to better handle decimal distance values returned by the ST_Distance function. The changes ensure compatibility with spatial queries that rely on precise distance calculations.

Parameter Type Update for Spatial Methods:

  • CHANGELOG.md: Documented the fix for $distance parameter type from int to float in scopeWithinDistanceTo and related methods.
  • src/Traits/HasSpatial.php: Updated the $distance parameter type in the scopeWithinDistanceTo method from int to float.
  • src/Traits/HasSpatial.php: Updated the $distance parameter type in the withinDistanceToMysqlAndPostgres private method from int to float.
  • src/Traits/HasSpatial.php: Updated the $distance parameter type in the withinDistanceToMariaDb private method from int to float.

@tkaratug tkaratug requested a review from deligoez June 12, 2025 08:43
@tkaratug tkaratug self-assigned this Jun 12, 2025
@tkaratug tkaratug merged commit 7cf2956 into 2.x Jun 12, 2025
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants