Skip to content

Conversation

@tkaratug
Copy link
Collaborator

This pull request introduces support for handling database expressions in the get() method of the LocationCast class, along with corresponding tests. The key updates include refactoring the get() method, adding a helper method for parsing expressions, and expanding test coverage to verify the new functionality.

Enhancements to LocationCast functionality:

  • Added support for database expressions in the get() method by introducing a new private helper method, getCoordinates, to handle parsing of ST_GeomFromText expressions. (src/Casts/LocationCast.php: [1] [2]

Test coverage improvements:

  • Added a new test, it_can_get_a_casted_attribute_using_expression, to validate that the get() method correctly processes attributes provided as database expressions. (tests/LocationCastTest.php: tests/LocationCastTest.phpR77-R94)
  • Included the necessary Expression import to support the new test. (tests/LocationCastTest.php: tests/LocationCastTest.phpR5)

Documentation updates:

  • Updated the CHANGELOG.md file to document the addition of expression support in the get() method for version 2.2.0. (CHANGELOG.md: CHANGELOG.mdR5-R7)

@tkaratug tkaratug merged commit ed03da2 into 2.x May 14, 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.

3 participants