Proposing a New Validation Rule for Longitude, Latitude, and Street View Camera Angle #52804
Unanswered
asfiaaiman
asked this question in
Ideas
Replies: 2 comments 2 replies
-
Nice idea |
Beta Was this translation helpful? Give feedback.
0 replies
-
1. + 2. Keep in mind, that there could be different notations, so it might not be a good idea to favor one above the other:
3. "Street View Camera Angle" seems oddly specific—in other words: proprietary validation rules are probably not wanted and it's recommended to create a package for that. However, "angle" might be fine (You can name your field "street_view_camera_angle" but a core validation rule would probably be "angle"). |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I propose adding a new custom validation rule to Laravel that will handle validation for longitude, latitude, and Street View camera angle values. This rule will also account for optional degree signs (°) that might be included with these values.
Criteria: Should be within -180 to 180 degrees.
Example Valid Inputs: -73.935242, 45.0, 180°
Example Invalid Inputs: -181, 200, abc
Criteria: Should be within -90 to 90 degrees.
Example Valid Inputs: 40.712776, -34.052235, 90°
Example Invalid Inputs: -91, 100, xyz
Criteria: Should be between 0 and 360 degrees.
Example Valid Inputs: 0, 180.5, 360°
Example Invalid Inputs: -10, 400, angle
Beta Was this translation helpful? Give feedback.
All reactions